1 package Koha::AdditionalContent;
3 # Copyright ByWater Solutions 2015
5 # This file is part of Koha.
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.
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.
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>.
24 use Koha::DateUtils qw( dt_from_string );
28 use base qw(Koha::Object);
32 Koha::AdditionalContent - Koha Additional content object class
42 $additional_content->author;
44 Return the Koha::Patron object for the patron who authored this additional content
50 my $author_rs = $self->_result->borrowernumber;
51 return unless $author_rs;
52 return Koha::Patron->_new_from_dbic($author_rs);
57 my $is_expired = $additional_content->is_expired;
59 Returns 1 if the additional content is expired or 0;
66 return 0 unless $self->expirationdate;
67 return 1 if dt_from_string( $self->expirationdate ) < dt_from_string->truncate( to => 'day' );
73 my $library = $additional_content->library;
75 Returns Koha::Library object or undef
82 my $library_rs = $self->_result->branchcode;
83 return unless $library_rs;
84 return Koha::Library->_new_from_dbic( $library_rs );
93 return 'AdditionalContent';
98 Kyle M Hall <kyle@bywatersolutions.com>