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.
Created attachment 54217 [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.
Created attachment 54218 [details] [review] Bug 17091: Remove explicit declaration of Koha::Objects->update Test plan: prove t/db_dependent/Koha/Objects.t should return green
Created attachment 54219 [details] [review] Bug 17091: Remove explicit declaration of Koha::Objects->count Test plan: prove t/db_dependent/Koha/Objects.t should return green
Created attachment 54220 [details] [review] Bug 17091: Remove explicit declaration of Koha::Objects->pager Test plan: prove t/db_dependent/Koha/Objects.t should return green
Created attachment 54221 [details] [review] Bug 17091: Remove explicit declaration of Koha::Objects->reset Test plan: prove t/db_dependent/Koha/Objects.t should return green
Created attachment 54223 [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.
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>
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>
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>
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>
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>
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
Created attachment 55378 [details] [review] Bug 17091: Add delete to the Koha::Objects AUTOLOAD method Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
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>
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>
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>
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>
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>
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>
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>
Pushed to Master - Should be in the November 2016 release. Thanks!
Enhancement, skipping for 16.05.x