diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm index 90f288e683..41d58d00b5 100644 --- a/Koha/Statistic.pm +++ b/Koha/Statistic.pm @@ -20,6 +20,7 @@ use Modern::Perl; use Carp; use Koha::Database; +use Koha::Items; use base qw(Koha::Object); @@ -31,6 +32,19 @@ Koha::Statistic - Koha Statistic Object class =head2 Class methods +=head3 item + +my $item = $statistic->item; + +Return the item associated to this statistic. + +=cut + +sub item { + my ( $self ) = @_; + return Koha::Items->find( $self->itemnumber ); +} + =head2 Internal methods =head3 _type