Bug 24448: Add Koha::Biblio->subscriptions_count
This patch adds the handy subscriptions_count method to the Koha::Biblio
class. It is intended to be used as a shortcut for
$biblio->subscriptions->count
in places like the API where we can embed the output of a method.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Biblio.t \
t/db_dependent/Koha/Biblios.t
=> SUCCESS: Tests pass! i.e. Biblios.t still passes, and the tests for
the new method in Biblio.t pass as well.
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
81c93cac46
commit
575d5418ed
|
|
@ -517,6 +517,20 @@ sub subscriptions {
|
|||
return $self->{_subscriptions};
|
||||
}
|
||||
|
||||
=head3 subscriptions_count
|
||||
|
||||
my $subscriptions_count = $self->subscriptions_count
|
||||
|
||||
Returns the count of the the related Koha::Subscriptions object for this biblio
|
||||
|
||||
=cut
|
||||
|
||||
sub subscriptions_count {
|
||||
my ($self) = @_;
|
||||
|
||||
return $self->subscriptions->count;
|
||||
}
|
||||
|
||||
=head3 has_items_waiting_or_intransit
|
||||
|
||||
my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit
|
||||
|
|
|
|||
Loading…
Reference in New Issue