Lines 2-7
package Koha::Objects::Mixin::AdditionalFields;
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
|
|
5 |
use base qw(Koha::Objects::Mixin::ExtendedAttributes); |
6 |
|
5 |
=head1 NAME |
7 |
=head1 NAME |
6 |
|
8 |
|
7 |
Koha::Objects::Mixin::AdditionalFields |
9 |
Koha::Objects::Mixin::AdditionalFields |
Lines 56-61
sub filter_by_additional_fields {
Link Here
|
56 |
return $class->search(\%conditions, { join => [ ('additional_field_values') x $idx ] }); |
58 |
return $class->search(\%conditions, { join => [ ('additional_field_values') x $idx ] }); |
57 |
} |
59 |
} |
58 |
|
60 |
|
|
|
61 |
=head3 extended_attributes_config |
62 |
|
63 |
=cut |
64 |
|
65 |
sub extended_attributes_config { |
66 |
my ($self) = @_; |
67 |
|
68 |
my $tablename_query = $self->extended_attributes_tablename_query; |
69 |
|
70 |
return { |
71 |
'id_field' => { 'foreign' => 'record_id', 'self' => $self->_resultset->result_source->primary_columns }, |
72 |
'key_field' => 'field_id', |
73 |
'schema_class' => 'Koha::Schema::Result::AdditionalFieldValue', |
74 |
}; |
75 |
} |
76 |
|
77 |
sub extended_attributes_tablename_query { |
78 |
my ($self) = @_; |
79 |
|
80 |
return { 'tablename' => $self->_resultset->result_source->name, 'operator' => '=' }; |
81 |
} |
82 |
|
59 |
=head1 AUTHOR |
83 |
=head1 AUTHOR |
60 |
|
84 |
|
61 |
Koha Development Team <http://koha-community.org/> |
85 |
Koha Development Team <http://koha-community.org/> |
62 |
- |
|
|