[Koha-bugs] [Bug 29441] New: We should make our method returns consistent in Koha::Biblio
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Nov 9 14:44:09 CET 2021
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29441
Bug ID: 29441
Summary: We should make our method returns consistent in
Koha::Biblio
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: koha-bugs at lists.koha-community.org
Reporter: martin.renvoize at ptfs-europe.com
QA Contact: testopia at bugs.koha-community.org
We now have a few of 'get_marc_*' accessors in Koha::Biblio, but their returns
are really inconsistent.
I feel like we aught to try and make them as consistent as possible so future
developers can use them without having to dig through the code to see what they
return.
In `get_marc_notes` we return an array of note strings from the marc record..
these may be selective subfield concatenations and could be in various orders.
In `get_marc_host` we return either a Koha::Biblio object or the Biblio object
+ the subfield g, as a string, from the current records marc21 773 field we
used to find the host.
In `get_marc_components` we return an array of MARCXML strings.
I think we could do better here.. certainly with the `_components` and `_host`
routines either consistently returning Koha::Biblio/Koha::Biblios or MARCXML
string/strings for example. As for `get_marc_notes`, this is a little
different.. we could possibly return an array of MARC::Field objects for later
processing, or perhaps we aught to have a second naming scheme for returning
strings from MARC/Metadata vs retuning a marc/metadata object/string itself?
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list