Koha::Object::Mixin::AdditionalFields
package Koha::Foo;
use parent qw( Koha::Object Koha::Object::Mixin::AdditionalFields );
sub _type { 'Foo' }
package main;
use Koha::Foo;
Koha::Foos->find($id)->set_additional_fields(...);
$foo->set_additional_fields([
{
id => 1,
value => 'foo',
},
{
id => 2,
value => 'bar',
}
]);
Prepares additional field values from CGI input for use in set_additional_fields
Usage example for aqorders:
my @additional_fields = $order->prepare_cgi_additional_field_values( $input, 'aqorders' );
Similar to set_additional_fields, but instead of overwriting existing fields, only adds new ones
$foo->add_additional_fields(
{
'2' => [
'first value for field 2',
'second value for field 2'
],
'1' => ['first value for field 1']
},
'subscription'
);
Returns additional field values in the format expected by the .tt file
my $fields = Koha::Acquisition::Baskets->find($basketno)->get_additional_field_values_for_template;
Expected format is a hash of arrays, where the hash key is the field id and its respective array contains the field values 'value' for that field. Example where field_id = 2 is the only repeatable field:
{ '3' => ['first value for field 3'], '1' => ['first value for field 1'], '4' => ['first value for field 4'], '2' => [ 'first value for field 2', 'second value for field 2', 'third value for field 2' ] };
Returns additional field values
my @values = $foo->additional_field_values;
REST API embed of additional_field_values
Returns a map of column name to string representations including the string, the mapping type and the mapping category where appropriate.
Currently handles additional fields values mappings.
Accepts a param hashref where the 'public' key denotes whether we want the public or staff interface strings.
Koha Development Team <http://koha-community.org/>
Copyright 2018 BibLibre
This file is part of Koha.
Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Koha; if not, see <http://www.gnu.org/licenses>.