Bugzilla – Attachment 150717 Details for
Bug 22440
Improve ILL page performance by moving to server side filtering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22440: Add standard accessors for later usage
Bug-22440-Add-standard-accessors-for-later-usage.patch (text/plain), 4.31 KB, created by
Martin Renvoize (ashimema)
on 2023-05-05 11:04:48 UTC
(
hide
)
Description:
Bug 22440: Add standard accessors for later usage
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-05-05 11:04:48 UTC
Size:
4.31 KB
patch
obsolete
>From 349bfdcbd5ddb947a469bd0b32800946ed9430a1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 30 Mar 2023 10:54:51 +0200 >Subject: [PATCH] Bug 22440: Add standard accessors for later usage > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Illrequest.pm | 61 +++++++++++++++++++++++++++----- > Koha/Illrequestattribute.pm | 16 +++++++-- > Koha/Schema/Result/Illrequest.pm | 33 ++++++++++++++++- > 3 files changed, 99 insertions(+), 11 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index d160c152b8..4187ba152e 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -192,6 +192,21 @@ sub illcomments { > ); > } > >+=head3 comments >+ >+ my $ill_comments = $req->comments; >+ >+Returns a I<Koha::Illcomments> resultset for the linked comments. >+ >+=cut >+ >+sub comments { >+ my ( $self ) = @_; >+ return Koha::Illcomments->_new_from_dbic( >+ scalar $self->_result->comments >+ ); >+} >+ > =head3 logs > > =cut >@@ -204,12 +219,45 @@ sub logs { > > =head3 patron > >+ my $patron = $request->patron; >+ >+Returns the linked I<Koha::Patron> object. >+ > =cut > > sub patron { > my ( $self ) = @_; >- return Koha::Patron->_new_from_dbic( >- scalar $self->_result->borrowernumber >+ >+ return Koha::Patron->_new_from_dbic( scalar $self->_result->patron ); >+} >+ >+=head3 library >+ >+ my $library = $request->library; >+ >+Returns the linked I<Koha::Library> object. >+ >+=cut >+ >+sub library { >+ my ($self) = @_; >+ >+ return Koha::Library->_new_from_dbic( scalar $self->_result->library ); >+} >+ >+=head3 ill_extended_attributes >+ >+ my $ill_extended_attributes = $request->ill_extended_attributes; >+ >+Returns the linked I<Koha::Illrequestattributes> resultset object. >+ >+=cut >+ >+sub ill_extended_attributes { >+ my ( $self ) = @_; >+ >+ return Koha::Illrequestattributes->_new_from_dbic( >+ scalar $self->_result->ill_extended_attributes > ); > } > >@@ -1142,12 +1190,9 @@ or undef if none exists > > sub biblio { > my ( $self ) = @_; >- >- return if !$self->biblio_id; >- >- return Koha::Biblios->find({ >- biblionumber => $self->biblio_id >- }); >+ my $biblio_rs = $self->_result->biblio; >+ return unless $biblio_rs; >+ return Koha::Biblio->_new_from_dbic($biblio_rs); > } > > =head3 check_out >diff --git a/Koha/Illrequestattribute.pm b/Koha/Illrequestattribute.pm >index 715b3f4752..6c0c584ddc 100644 >--- a/Koha/Illrequestattribute.pm >+++ b/Koha/Illrequestattribute.pm >@@ -31,8 +31,6 @@ Koha::Illrequestattribute - Koha Illrequestattribute Object class > > =head2 Internal methods > >-=cut >- > =head3 _type > > =cut >@@ -41,6 +39,20 @@ sub _type { > return 'Illrequestattribute'; > } > >+=head3 to_api_mapping >+ >+This method returns the mapping for representing a Koha::Illrequestattribute object >+on the API. >+ >+=cut >+ >+sub to_api_mapping { >+ return { >+ illrequest_id => 'ill_request_id', >+ readonly => 'read_only', >+ }; >+} >+ > =head1 AUTHOR > > Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >diff --git a/Koha/Schema/Result/Illrequest.pm b/Koha/Schema/Result/Illrequest.pm >index adc931336a..51dabbec12 100644 >--- a/Koha/Schema/Result/Illrequest.pm >+++ b/Koha/Schema/Result/Illrequest.pm >@@ -334,6 +334,37 @@ __PACKAGE__->belongs_to( > # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-23 18:44:13 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:on9OCRON/U0uR+m9aPIKPg > >+__PACKAGE__->has_many( >+ "comments", >+ "Koha::Schema::Result::Illcomment", >+ { "foreign.illrequest_id" => "self.illrequest_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+__PACKAGE__->has_many( >+ "ill_extended_attributes", >+ "Koha::Schema::Result::Illrequestattribute", >+ { "foreign.illrequest_id" => "self.illrequest_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+__PACKAGE__->belongs_to( >+ "library", >+ "Koha::Schema::Result::Branch", >+ { branchcode => "branchcode" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+__PACKAGE__->belongs_to( >+ "patron", >+ "Koha::Schema::Result::Borrower", >+ { borrowernumber => "borrowernumber" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "CASCADE", >+ on_update => "CASCADE", >+ }, >+); > >-# You can replace this text with custom code or comments, and it will be preserved on regeneration > 1; >-- >2.40.1
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 22440
:
150715
|
150716
| 150717 |
150718
|
150719
|
150720
|
150721
|
150722
|
150723
|
150788
|
150789