Bugzilla – Attachment 126615 Details for
Bug 29288
Add current_checkouts and old_checkouts methods to Koha::Biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Bug-29288-Add-currentcheckouts-and-oldcheckouts-me.patch (text/plain), 1.94 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-20 21:03:42 UTC
(
hide
)
Description:
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-20 21:03:42 UTC
Size:
1.94 KB
patch
obsolete
>From 88bf64a4737e9bd76b094dc9483915c51b286f3d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 20 Oct 2021 18:02:01 -0300 >Subject: [PATCH] Bug 29288: Add current_checkouts and old_checkouts methods to > Koha::Biblio > >This patch adds helper methods for accessing current and past checkouts >for a given Koha::Biblio object. > >To test: >1. Apply the unit tests >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Biblio.t >=> FAIL: Methods are not implemented >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Biblio.pm | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index e3618dc80f..bf61d7ec16 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -35,10 +35,12 @@ use Koha::Acquisition::Orders; > use Koha::ArticleRequests; > use Koha::Biblio::Metadatas; > use Koha::Biblioitems; >+use Koha::Checkouts; > use Koha::CirculationRules; > use Koha::Item::Transfer::Limits; > use Koha::Items; > use Koha::Libraries; >+use Koha::Old::Checkouts; > use Koha::Suggestions; > use Koha::Subscriptions; > >@@ -353,6 +355,36 @@ sub article_requests { > return Koha::ArticleRequests->_new_from_dbic( scalar $self->_result->article_requests ); > } > >+=head3 current_checkouts >+ >+ my $current_checkouts = $biblio->current_checkouts >+ >+Returns the current checkouts associated with this biblio >+ >+=cut >+ >+sub current_checkouts { >+ my ($self) = @_; >+ >+ return Koha::Checkouts->search( { "item.biblionumber" => $self->id }, >+ { join => 'item' } ); >+} >+ >+=head3 old_checkouts >+ >+ my $old_checkouts = $biblio->old_checkouts >+ >+Returns the past checkouts associated with this biblio >+ >+=cut >+ >+sub old_checkouts { >+ my ( $self ) = @_; >+ >+ return Koha::Old::Checkouts->search( { "item.biblionumber" => $self->id }, >+ { join => 'item' } ); >+} >+ > =head3 items > > my $items = $biblio->items(); >-- >2.32.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 29288
:
126614
|
126615
|
126629
|
126630
|
126642
|
126643
|
126973
|
126974