From b422e017eca6ad74f0f66d5fea181b01e48d661e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 7 May 2020 18:20:57 -0300 Subject: [PATCH] Bug 23185: Realistic POD for Koha::Objects->search Signed-off-by: Tomas Cohen Arazi --- Koha/Objects.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index c19ced53c1..2bf33917a7 100644 --- a/Koha/Objects.pm +++ b/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 the I 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 it returns an array of I objects. +In B it returns an iterator. =cut -- 2.26.2