Bugzilla – Attachment 76903 Details for
Bug 20287
Move AddMember and ModMember to Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20287: Koha::Object->get_from_storage
Bug-20287-KohaObject-getfromstorage.patch (text/plain), 1.56 KB, created by
Jonathan Druart
on 2018-07-12 18:49:05 UTC
(
hide
)
Description:
Bug 20287: Koha::Object->get_from_storage
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-12 18:49:05 UTC
Size:
1.56 KB
patch
obsolete
>From f44c6111b0c02f207e29327df073d2f282e27649 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 22 Feb 2018 11:19:50 -0300 >Subject: [PATCH] Bug 20287: Koha::Object->get_from_storage > >May be part of a separate bug report if needed > >TODO - add POD + tests > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Object.pm | 11 +++++++++++ > Koha/Schema/Result/Borrower.pm | 3 +++ > 2 files changed, 14 insertions(+) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index e35ff0b85e..e62af3eb11 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -219,6 +219,17 @@ sub unblessed { > return { $self->_result->get_columns }; > } > >+=head3 $object->get_from_storage; >+ >+=cut >+ >+sub get_from_storage { >+ my ( $self, $attrs ) = @_; >+ my $stored_object = $self->_result->get_from_storage($attrs); >+ my $object_class = Koha::Object::_get_object_class( $self->_result->result_class ); >+ return $object_class->_new_from_dbic($stored_object); >+} >+ > =head3 $object->TO_JSON > > Returns an unblessed representation of the object, suitable for JSON output. >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 8663b8654b..3381116ead 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1433,5 +1433,8 @@ __PACKAGE__->add_columns( > sub koha_objects_class { > 'Koha::Patrons'; > } >+sub koha_object_class { >+ 'Koha::Patron'; >+} > > 1; >-- >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 20287
:
73436
|
76901
|
76902
| 76903 |
76904
|
76905
|
76906
|
76907
|
76908
|
76909
|
76910
|
76911
|
76912
|
76913
|
76914
|
76915
|
76916
|
76917
|
76918
|
76919
|
76920
|
76921
|
76922
|
76923
|
76924
|
76927
|
77221