On 17 Oct 2010, at 00:01, Owen Winkler wrote: > I think that Vocabulary::get_terms() should return a consistent data type. > Whether there is a Terms or just an array of Term, I do think it should > always return an array, even if there is one. As a recipient of the result, > you shouldn't need to test for the type of value returned, simply assume that > it's an array of some kind. > > Incidentally, I believe that Posts::get() always returns an array unless you > specifically request only one. I think if we persisted this behavior to > Vocabulary::get_terms() that would also be fine. Also note that Posts::get() > returns a Posts ArrayObject, not just a plain array.
I'm not up to speed on the code, but purely from a design point of view ^^^^^^^ is so right. Perhaps have Posts::first() or Posts::one() that calls ::get() and returns just the first (or only) object from the array, but ::get() always returns an array. +1 for consistency between classes too. C --- Caius Durling [email protected] +44 (0) 7960 268 100 http://caius.name/ -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/habari-dev
