Bug 17091 - Add AUTOLOAD to Koha::Objects
Summary: Add AUTOLOAD to Koha::Objects
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 16961
Blocks: 14899 17094 17226 17425 17552 19989
  Show dependency treegraph
 
Reported: 2016-08-09 15:12 UTC by Jonathan Druart
Modified: 2018-12-03 20:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17091: Add AUTOLOAD to Koha::Objects (1.52 KB, patch)
2016-08-09 15:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->update (968 bytes, patch)
2016-08-09 15:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->count (834 bytes, patch)
2016-08-09 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->pager (1.63 KB, patch)
2016-08-09 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->reset (1.87 KB, patch)
2016-08-09 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects (1.95 KB, patch)
2016-08-09 15:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: Add AUTOLOAD to Koha::Objects (1.59 KB, patch)
2016-08-10 14:43 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->update (1.02 KB, patch)
2016-08-10 14:43 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->count (909 bytes, patch)
2016-08-10 14:43 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->pager (1.70 KB, patch)
2016-08-10 14:44 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->reset (1.95 KB, patch)
2016-08-10 14:44 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects (2.08 KB, patch)
2016-08-10 14:44 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 17091: Add delete to the Koha::Objects AUTOLOAD method (2.37 KB, patch)
2016-09-08 18:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17091: Add AUTOLOAD to Koha::Objects (1.63 KB, patch)
2016-10-11 09:13 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->update (1.06 KB, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->count (948 bytes, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->pager (1.74 KB, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: Remove explicit declaration of Koha::Objects->reset (1.98 KB, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects (2.12 KB, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17091: Add delete to the Koha::Objects AUTOLOAD method (2.43 KB, patch)
2016-10-11 09:14 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-08-09 15:12:54 UTC
Up to now if a Koha::Objects based object needs to call DBIx::Class methods, we have to create a new method for Koha::Objects, something like:
  sub method {
    my $self = shift;
    return $self->_resultset->method
  }

To simplify and ease the call to DBIx::Class method, we could create an AUTOLOAD method.
Comment 1 Jonathan Druart 2016-08-09 15:23:55 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-08-09 15:23:58 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-08-09 15:24:01 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-08-09 15:24:05 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-08-09 15:24:09 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-08-09 15:37:12 UTC Comment hidden (obsolete)
Comment 7 Héctor Eduardo Castro Avalos 2016-08-10 14:43:22 UTC
Created attachment 54272 [details] [review]
[SIGNED-OFF]Bug 17091: Add AUTOLOAD to Koha::Objects

Up to now if a Koha::Objects based object needs to call DBIx::Class methods, we
have to create a new method for Koha::Objects, something like:
  sub method {
    my $self = shift;
    return $self->_resultset->method
  }

To simplify and ease the call to DBIx::Class method, this patch defines an
AUTOLOAD to call the DBIx::Class method on the resultset we are encapsulating.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 8 Héctor Eduardo Castro Avalos 2016-08-10 14:43:40 UTC
Created attachment 54273 [details] [review]
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->update

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 9 Héctor Eduardo Castro Avalos 2016-08-10 14:43:59 UTC
Created attachment 54274 [details] [review]
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->count

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 10 Héctor Eduardo Castro Avalos 2016-08-10 14:44:30 UTC
Created attachment 54275 [details] [review]
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->pager

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 11 Héctor Eduardo Castro Avalos 2016-08-10 14:44:36 UTC
Created attachment 54276 [details] [review]
[SIGNED-OFF]Bug 17091: Remove explicit declaration of Koha::Objects->reset

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 12 Héctor Eduardo Castro Avalos 2016-08-10 14:44:41 UTC
Created attachment 54277 [details] [review]
[SIGNED-OFF]Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects

To make sure the methods will be covered by tests and devs won't
overused this method, I think it may be a good idea to restrict its
usage.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
AUTOLOAD added. No Koha QA errors. Test passed successfully
Comment 13 Jonathan Druart 2016-09-08 18:18:09 UTC
Created attachment 55378 [details] [review]
Bug 17091: Add delete to the Koha::Objects AUTOLOAD method

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 14 Kyle M Hall 2016-10-11 09:13:42 UTC
Created attachment 56142 [details] [review]
Bug 17091: Add AUTOLOAD to Koha::Objects

Up to now if a Koha::Objects based object needs to call DBIx::Class methods, we
have to create a new method for Koha::Objects, something like:
  sub method {
    my $self = shift;
    return $self->_resultset->method
  }

To simplify and ease the call to DBIx::Class method, this patch defines an
AUTOLOAD to call the DBIx::Class method on the resultset we are encapsulating.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Kyle M Hall 2016-10-11 09:14:05 UTC
Created attachment 56143 [details] [review]
Bug 17091: Remove explicit declaration of Koha::Objects->update

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 16 Kyle M Hall 2016-10-11 09:14:15 UTC
Created attachment 56144 [details] [review]
Bug 17091: Remove explicit declaration of Koha::Objects->count

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall 2016-10-11 09:14:23 UTC
Created attachment 56145 [details] [review]
Bug 17091: Remove explicit declaration of Koha::Objects->pager

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Kyle M Hall 2016-10-11 09:14:32 UTC
Created attachment 56146 [details] [review]
Bug 17091: Remove explicit declaration of Koha::Objects->reset

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Kyle M Hall 2016-10-11 09:14:39 UTC
Created attachment 56147 [details] [review]
Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects

To make sure the methods will be covered by tests and devs won't
overused this method, I think it may be a good idea to restrict its
usage.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
AUTOLOAD added. No Koha QA errors. Test passed successfully

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Kyle M Hall 2016-10-11 09:14:51 UTC
Created attachment 56148 [details] [review]
Bug 17091: Add delete to the Koha::Objects AUTOLOAD method

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 21 Brendan Gallagher 2016-10-12 10:27:33 UTC
Pushed to Master - Should be in the November 2016 release.  Thanks!
Comment 22 Mason James 2016-12-14 10:09:40 UTC
Enhancement, skipping for 16.05.x