Swift_Iterator and Iterator

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
idunno246
Forum Newbie
Posts: 1
Joined: Wed Jul 23, 2008 6:21 pm

Swift_Iterator and Iterator

Post by idunno246 »

I have a class that implements the php iterator that I would like to also implement swift_iterator. It seems likethis isnt possible because they both have a next() function?
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Swift_Iterator and Iterator

Post by ghurtado »

It's not impossible, since implementing an interface is just a matter of implementing a set of methods. So long as you have the same method signatures as the interface you are following the blueprint set by it. If several interfaces have the same methods, so long as the signatures are the same, you can implement them all at once.
Post Reply