|
Line 0
Link Here
|
|
|
1 |
package Koha::Item::Bundle; |
| 2 |
|
| 3 |
# Copyright Koha Development Team 2023 |
| 4 |
# |
| 5 |
# This file is part of Koha. |
| 6 |
# |
| 7 |
# Koha is free software; you can redistribute it and/or modify it |
| 8 |
# under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# Koha is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 19 |
|
| 20 |
use Modern::Perl; |
| 21 |
use Koha::Item; |
| 22 |
|
| 23 |
use base qw(Koha::Object); |
| 24 |
|
| 25 |
=head1 NAME |
| 26 |
|
| 27 |
Koha::Item::Bundle - Koha item bundle object |
| 28 |
|
| 29 |
=head1 METHODS |
| 30 |
|
| 31 |
=head2 item_object |
| 32 |
|
| 33 |
$item_bundle->item_object; |
| 34 |
|
| 35 |
=cut |
| 36 |
|
| 37 |
sub item_object { # name chosen different from column 'item' |
| 38 |
my ( $self ) = @_; |
| 39 |
return Koha::Item->_new_from_dbic( $self->_result->item ); |
| 40 |
} |
| 41 |
|
| 42 |
=head2 host_item |
| 43 |
|
| 44 |
$item_bundle->host_item.barcode; |
| 45 |
|
| 46 |
=cut |
| 47 |
|
| 48 |
sub host_item { |
| 49 |
my ( $self ) = @_; |
| 50 |
return Koha::Item->_new_from_dbic( $self->_result->host ); |
| 51 |
} |
| 52 |
|
| 53 |
=head1 INTERNAL METHODS |
| 54 |
|
| 55 |
=head2 _type |
| 56 |
|
| 57 |
=cut |
| 58 |
|
| 59 |
sub _type { |
| 60 |
return 'ItemBundle'; |
| 61 |
} |
| 62 |
|
| 63 |
1; |