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