Browse Source

Bug 23185: Realistic POD for Koha::Objects->search

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
20.05.x
Tomás Cohen Arazi 4 years ago
parent
commit
b422e017ec
  1. 16
      Koha/Objects.pm

16
Koha/Objects.pm

@ -118,9 +118,21 @@ sub find_or_create {
return $object;
}
=head3 Koha::Objects->search();
=head3 search
# list context
my @objects = Koha::Objects->search([$params, $attributes]);
# scalar context
my $objects = Koha::Objects->search([$params, $attributes]);
while (my $object = $objects->next) {
do_stuff($object);
}
This B<instantiates> the I<Koha::Objects> class, and generates a resultset
based on the query I<$params> and I<$attributes> that are passed (like in DBIC).
my @objects = Koha::Objects->search($params);
In B<list context> it returns an array of I<Koha::Object> objects.
In B<scalar context> it returns an iterator.
=cut

Loading…
Cancel
Save