[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
Wed Jan 8 16:26:18 CET 2020


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

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Text to go in the|This patch introduces a     |This patch introduces a
      release notes|parameter to the            |parameter to the
                   |Koha::Object class          |Koha::Object class
                   |('embed') that should be a  |('embed') that should be a
                   |hashref pointing to a data  |hashref pointing to a data
                   |structure following what's  |structure following what's
                   |documented in the code.     |documented in the code.
                   |This parameter allows the   |This parameter allows the
                   |caller to specify things to |caller to specify things to
                   |embed recursively in the    |embed recursively in the
                   |API representation of the   |API representation of the
                   |object. For example: you    |object. For example: you
                   |could request a biblio      |could request a biblio
                   |object with its items       |object with its items
                   |attached, like this:
       |attached, like this:
                   |
                           |
                   |                            |
                   |$biblio_json =              |$biblio_json =
                   |$biblio->to_api({ embed =>  |$biblio->to_api({ embed =>
                   |{ items => {} } });
        |{ items => {} } });
                   |
                           |
                   |The                         |The
                   |main use of this is the     |names specified for
                   |API, as introduced by bug   |embedding, are used as
                   |24302.
                     |attribute names on the
                   |                            |resulting JSON object, and
                   |Koha::Objects->to_api is    |are expected to be class
                   |adjusted to pass its        |accessors.
                   |parameters down to the      |
                   |Koha::Object.               |The main use of
                   |                            |this is the API, as
                   |                            |introduced by bug 24302.
                   |                            |
                   |                            |Koha::Objects->to_api is
                   |                            |adjusted to pass its
                   |                            |parameters down to the
                   |                            |Koha::Object.

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


More information about the Koha-bugs mailing list