[Koha-bugs] [Bug 24228] Add a parameter to recursively embed objects in Koha::Object(s)->to_api

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 7 20:12:22 CET 2020


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

--- Comment #16 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 96955
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96955&action=edit
Bug 24228: Make ->to_api params a hashref

This patch makes the parameters for Koha::Object(s)->to_api a hashref
preparing the ground for new parameters. The proposed syntax is:

$object->to_api(
    {
        embed => {
            'items' => {
                'children' => {
                    'homebranch' => {}
                }
            }
        }
    }
);

Tests are added for the Koha::Objects implementation and tests for
Koha::Object are adjusted to the new syntax, and a test for the single
result accessor is added as well.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

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


More information about the Koha-bugs mailing list