@@ -, +, @@ $count = $biblio->items->count; $count = $biblio->items_count; $biblio->to_api({ embed => { items_count => {} } }); $ kshell k$ prove t/db_dependent/Koha/Biblio.t --- Koha/Biblio.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -411,6 +411,20 @@ sub items { return Koha::Items->_new_from_dbic( $items_rs ); } +=head3 items_count + +my $items_count = $biblio->items(); + +Returns the count of the the related Koha::Items object for this biblio + +=cut + +sub items_count { + my ($self) = @_; + + return $self->_result->items->count; +} + =head3 itemtype my $itemtype = $biblio->itemtype(); --