https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28871

--- Comment #16 from Tomás Cohen Arazi <[email protected]> ---
(In reply to Marcel de Rooy from comment #15)
> (In reply to Tomás Cohen Arazi from comment #0)
> > To test:
> > my @patrons = Koha::Patrons->new->empty;
> > Dumper(@patrons);
> 
> What is the practical use of doing so?

You should git grep '\->empty'

The existence of ->empty is meant for consistency in results, and also to avoid
querying the DB for empty results when we know in advance that we need an empty
resultset.

> I would prefer my @patrons;

Right, but my example was too simple. Sometimes ->empty is called implicitly
somewhere else, far from the code you're looking at.

> Was there some intention to use empty with chaining?

empty is there so you don't need to do things like:

if ( $result->count > 0 ) {
    $result = $result->filter_by_something_else;
}

you just chain your queries and know it will work...

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to