Lines 1-31
Link Here
|
1 |
package Koha::Acquisition::Bookseller; |
1 |
package Koha::Acquisition::Bookseller; |
2 |
|
2 |
|
|
|
3 |
# This file is part of Koha. |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it under the |
6 |
# terms of the GNU General Public License as published by the Free Software |
7 |
# Foundation; either version 3 of the License, or (at your option) any later |
8 |
# version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
11 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
12 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
13 |
# |
14 |
# You should have received a copy of the GNU General Public License along |
15 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
16 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 |
|
3 |
use Modern::Perl; |
18 |
use Modern::Perl; |
4 |
|
19 |
|
5 |
use Koha::Database; |
20 |
use Koha::Acquisition::Bookseller::Contacts; |
|
|
21 |
use Koha::Subscriptions; |
22 |
|
6 |
use base qw( Koha::Object ); |
23 |
use base qw( Koha::Object ); |
7 |
|
24 |
|
8 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
25 |
=head1 NAME |
9 |
|
26 |
|
10 |
use Koha::Acquisition::Bookseller::Contacts; |
27 |
Koha::Acquisition::Bookseller Object class |
11 |
use Koha::Subscriptions; |
28 |
|
|
|
29 |
=head1 API |
30 |
|
31 |
=head2 Class Methods |
32 |
|
33 |
=head3 baskets |
34 |
|
35 |
my $vendor = Koha::Acquisition::Booksellers->find( $id ); |
36 |
my @baskets = $vendor->baskets(); |
37 |
|
38 |
Returns the list of baskets for the vendor |
39 |
|
40 |
=cut |
12 |
|
41 |
|
13 |
sub baskets { |
42 |
sub baskets { |
14 |
my ( $self ) = @_; |
43 |
my ( $self ) = @_; |
15 |
return $self->{_result}->aqbaskets; |
44 |
return $self->{_result}->aqbaskets; |
16 |
} |
45 |
} |
17 |
|
46 |
|
|
|
47 |
=head3 contacts |
48 |
|
49 |
my $vendor = Koha::Acquisition::Booksellers->find( $id ); |
50 |
my @contacts = $vendor->contacts(); |
51 |
|
52 |
Returns the list of contacts for the vendor |
53 |
|
54 |
=cut |
55 |
|
18 |
sub contacts { |
56 |
sub contacts { |
19 |
my ($self) = @_; |
57 |
my ($self) = @_; |
20 |
return Koha::Acquisition::Bookseller::Contacts->search( { booksellerid => $self->id } ); |
58 |
return Koha::Acquisition::Bookseller::Contacts->search( { booksellerid => $self->id } ); |
21 |
} |
59 |
} |
22 |
|
60 |
|
|
|
61 |
=head3 subscriptions |
62 |
|
63 |
my $vendor = Koha::Acquisition::Booksellers->find( $id ); |
64 |
my @subscriptions = $vendor->subscriptions(); |
65 |
|
66 |
Returns the list of subscriptions for the vendor |
67 |
|
68 |
=cut |
69 |
|
23 |
sub subscriptions { |
70 |
sub subscriptions { |
24 |
my ($self) = @_; |
71 |
my ($self) = @_; |
25 |
|
72 |
|
26 |
return Koha::Subscriptions->search( { aqbooksellerid => $self->id } ); |
73 |
return Koha::Subscriptions->search( { aqbooksellerid => $self->id } ); |
27 |
} |
74 |
} |
28 |
|
75 |
|
|
|
76 |
=head2 Internal methods |
77 |
|
78 |
=head3 _type |
79 |
|
80 |
=cut |
81 |
|
29 |
sub _type { |
82 |
sub _type { |
30 |
return 'Aqbookseller'; |
83 |
return 'Aqbookseller'; |
31 |
} |
84 |
} |