Bug 24356: Make objects.search prefetch embedded relations
authorAgustin Moyano <agustinmoyano@theke.io>
Tue, 21 Jan 2020 15:39:49 +0000 (12:39 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Feb 2020 13:20:57 +0000 (13:20 +0000)
commitb2ad63582520f49ad3c03ca29975d99fa2ef2ecf
treee1a1316244828e17789dbd6ccd7ad1e403464eaf
parenta7bf8a488f4357e016ef1f43d89a241ff2fbb3bf
Bug 24356: Make objects.search prefetch embedded relations

This patch makes the Koha::Object(s) derived classes expose information
about prefetch-able relations. This is then used by a new helper to
generate the prefetch information for the DBIC query.

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Object.pm
Koha/Objects.pm
Koha/REST/Plugin/Objects.pm
Koha/REST/Plugin/Query.pm
t/Koha/REST/Plugin/Query.t