Bug 23281: Cleanup Koha::Patron::Attribute::Types->search
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
90b48c2c48
commit
e31cddf8b0
|
|
@ -27,39 +27,11 @@ Koha::Patron::Attribute::Types Object set class
|
|||
|
||||
=head1 API
|
||||
|
||||
=head2 Class Methods
|
||||
=head2 Internal methods
|
||||
|
||||
=cut
|
||||
|
||||
=head3 Koha::Patron::Attribute::Types->search();
|
||||
|
||||
my @attribute_types = Koha::Patron::Attribute::Types->search($params);
|
||||
|
||||
=cut
|
||||
|
||||
sub search {
|
||||
my ( $self, $params, $attributes ) = @_;
|
||||
|
||||
my $branchcode = $params->{branchcode};
|
||||
delete( $params->{branchcode} );
|
||||
|
||||
my $or =
|
||||
$branchcode
|
||||
? {
|
||||
'-or' => [
|
||||
'borrower_attribute_types_branches.b_branchcode' => undef,
|
||||
'borrower_attribute_types_branches.b_branchcode' => $branchcode,
|
||||
]
|
||||
}
|
||||
: {};
|
||||
my $join = $branchcode ? { join => 'borrower_attribute_types_branches' } : {};
|
||||
$attributes //= {};
|
||||
$attributes = { %$attributes, %$join };
|
||||
return $self->SUPER::search( { %$params, %$or, }, $attributes );
|
||||
}
|
||||
|
||||
|
||||
=head3 type
|
||||
=head3 _type
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue