Taco Van Den Broek wrote:
> Hans Lellelid wrote: >> static, default behavior, probably accounts for 80% of uses: >> >> $c = new Criteria(Author::NAME, "Leo"); >> $a = AuthorFinder::find($c); > > > You pass your criteria to your search class as instantiated objects, why > don't you pass your parameters/config flags as another type of object? > Maybe like this: > > $c = new Criteria(Author::NAME, "Leo"); > $f = new ConfigFlag(AuthorFinder::LIMIT, '5'); > $a = AuthorFinder::find($c, $f); > > You could then check the $f object for any customizations, just like you > check the $c object for where to search.
That's a good suggestion -- probably the cleanest design possible in current PHP object model.
Thanks, Hans
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php