From 4cf0e06311ac9424241a245fc0115a6814f9fb7b Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Fri, 19 Nov 2021 09:37:38 -0300
Subject: [PATCH] Bug 29523: Add Koha::Objects->search_limited stub method

This method is just a passthru to the search method. It is defined here
to avoid the need to check if each class implements it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
 Koha/Objects.pm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Koha/Objects.pm b/Koha/Objects.pm
index dc3d044bd3c..706ddba69ed 100644
--- a/Koha/Objects.pm
+++ b/Koha/Objects.pm
@@ -142,6 +142,21 @@ sub search {
     return $class->_new_from_dbic($rs);
 }
 
+=head3 search_limited
+
+    my $rs = $self->search_limited
+
+Generic method that is just a pass through for I<search>. It is expected to be overloaded
+locally on classes. It's main purpose is to avoid the need to check if the class implements
+the method locally.
+
+=cut
+
+sub search_limited {
+    my ( $self, $params, $attributes ) = @_;
+    return $self->search( $params, $attributes );
+}
+
 =head3 search_related
 
     my $objects = Koha::Objects->search_related( $rel_name, $cond?, \%attrs? );
-- 
2.34.1