Bug 19926: Add the Koha::Object->unblessed_all_relateds method
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 8 Jan 2018 16:19:16 +0000 (13:19 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 Apr 2018 14:43:06 +0000 (11:43 -0300)
commitb5bbda68fa7d73469f625d40ccee346f48db40bd
treeca71d0c2ffe94d9e9f6d5251185593f58b94800c
parent28c39d5c8642d167b66446ab36dedc447dc076c9
Bug 19926: Add the Koha::Object->unblessed_all_relateds method

In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.

See dependent bugs to understand the context and test this patch.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Object.pm