Bugzilla – Attachment 37215 Details for
Bug 13905
Wrapping DBIx count inside Koha Object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13905 - Wrapping DBIx count inside Koha Object
Bug-13905---Wrapping-DBIx-count-inside-Koha-Object.patch (text/plain), 995 bytes, created by
Olli-Antti Kivilahti
on 2015-03-25 13:50:22 UTC
(
hide
)
Description:
Bug 13905 - Wrapping DBIx count inside Koha Object
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-03-25 13:50:22 UTC
Size:
995 bytes
patch
obsolete
>From d6cee3092409769c769a46fcae6957c3d81345be Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 25 Mar 2015 15:47:15 +0200 >Subject: [PATCH] Bug 13905 - Wrapping DBIx count inside Koha Object > >DBIx::Class::ResultSet has a handy method count() to see how many results this >prepared ResultSet would return. > >This is hidden by the Koha::Object. > >This patch adds a wrapper for the count() method inside the Koha::Object, so it >is nicely available for all subclasses. >--- > Koha/Object.pm | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index a77eb5c..bc3d60a 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -207,6 +207,17 @@ sub id { > return $id; > } > >+=head3 $object->count(); >+ >+Returns how many objects like this are in the DB. >+ >+=cut >+ >+sub count { >+ my ($self) = @_; >+ return $self->_result()->count(); >+} >+ > =head3 $object->_result(); > > Returns the internal DBIC Row object >-- >1.7.9.5
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 13905
: 37215