Bugzilla – Attachment 97572 Details for
Bug 24448
Add Koha::Biblio->subscriptions_count
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24448: Add Koha::Biblio->subscriptions_count
Bug-24448-Add-KohaBiblio-subscriptionscount.patch (text/plain), 1.47 KB, created by
Nick Clemens (kidclamp)
on 2020-01-17 20:28:14 UTC
(
hide
)
Description:
Bug 24448: Add Koha::Biblio->subscriptions_count
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-17 20:28:14 UTC
Size:
1.47 KB
patch
obsolete
>From 2c0d1aa679681b7716458b3cc30f5d87bec348b1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 17 Jan 2020 11:18:41 -0300 >Subject: [PATCH] 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> >--- > Koha/Biblio.pm | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 7c6e47328c..28609dc51d 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -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 >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24448
:
97525
|
97526
|
97571
|
97572
|
98033
|
98034
|
98036