|
Lines 24-29
use Carp;
Link Here
|
| 24 |
use Koha::Database; |
24 |
use Koha::Database; |
| 25 |
|
25 |
|
| 26 |
use Koha::Biblio; |
26 |
use Koha::Biblio; |
|
|
27 |
use Koha::Libraries; |
| 27 |
|
28 |
|
| 28 |
use base qw(Koha::Objects); |
29 |
use base qw(Koha::Objects); |
| 29 |
|
30 |
|
|
Lines 33-42
Koha::Biblios - Koha Biblio object set class
Link Here
|
| 33 |
|
34 |
|
| 34 |
=head1 API |
35 |
=head1 API |
| 35 |
|
36 |
|
| 36 |
=head2 Class Methods |
37 |
=head2 Class methods |
|
|
38 |
|
| 39 |
=head3 pickup_locations |
| 40 |
|
| 41 |
my $biblios = Koha::Biblios->search(...); |
| 42 |
my $pickup_locations = $biblios->pickup_locations({ patron => $patron }); |
| 43 |
|
| 44 |
For a given resultset, it returns all the pickup locations |
| 37 |
|
45 |
|
| 38 |
=cut |
46 |
=cut |
| 39 |
|
47 |
|
|
|
48 |
sub pickup_locations { |
| 49 |
my ( $self, $params ) = @_; |
| 50 |
|
| 51 |
my $patron = $params->{patron}; |
| 52 |
|
| 53 |
my @pickup_locations; |
| 54 |
foreach my $biblio ( $self->as_list ) { |
| 55 |
push @pickup_locations, |
| 56 |
$biblio->pickup_locations( { patron => $patron } ) |
| 57 |
->_resultset->get_column('branchcode')->all; |
| 58 |
} |
| 59 |
|
| 60 |
return Koha::Libraries->search( |
| 61 |
{ |
| 62 |
branchcode => \@pickup_locations |
| 63 |
}, |
| 64 |
{ order_by => ['branchname'] } |
| 65 |
); |
| 66 |
} |
| 67 |
|
| 68 |
=head2 Internal methods |
| 69 |
|
| 40 |
=head3 type |
70 |
=head3 type |
| 41 |
|
71 |
|
| 42 |
=cut |
72 |
=cut |
| 43 |
- |
|
|