[Koha-bugs] [Bug 25296] Add a way to force an empty Koha::Objects resultset

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 28 16:01:39 CEST 2020


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #103812|0                           |1
        is obsolete|                            |

--- Comment #8 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 103861
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103861&action=edit
Bug 25296: Add a way to force an empty Koha::Objects resultset

This patch adds a new ->empty method to Koha::Objects, that can be used
to make the underlying DBIC resultset empty. This way, we can have
consistency in our method's return values without the need to build
a query that we know in advance that will be empty. No need to hit the
DB at all.

To test:
1. Apply this patches
2. Notice the tests cover what is expected
3. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass! Yay!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list