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)
committerJoy Nelson <joy@bywatersolutions.com>
Sat, 18 Jan 2020 16:24:19 +0000 (16:24 +0000)
commit59a92c1036ce73e56410c8ff317e19550fdb2e99
treedff4fee3b9cb7f3a91d86ece74b5f791c97a82eb
parent502c8d046aee82bd82fd894615a6d32ec5e635bc
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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Koha/Object.pm
Koha/Objects.pm
t/db_dependent/Koha/Object.t