Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects
authorAgustin Moyano <agustinmoyano@theke.io>
Thu, 19 Dec 2019 18:50:49 +0000 (15:50 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 Jan 2020 15:07:25 +0000 (15:07 +0000)
commitf87ebb9ab1eb61002a5b97f9bf31e2b5d77b25d0
treeaa33e7f600e33018cd4352b10a864da9f1fffd20
parent9bcf22b0d57fce9d0c38006cd204e3a1cba5b361
Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects

This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that
using dot notation (e.g. resource.related_resource.another_one) allows
embedding objects recursively.

To test:
1. Apply this patch
2. prove t/db_dependent/Koha/Object.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Object.pm
Koha/Objects.pm
t/db_dependent/Koha/Object.t