Bug 16961

Summary: Add the Koha::Objects->update method
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: hector.hecaxmmx, katrin.fischer, kyle, m.de.rooy
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18174
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13019    
Bug Blocks: 16965, 16966, 17091    
Attachments: Bug 16961: Add Koha::Objects->update
[SIGNED-OFF]Bug 16961: Add Koha::Objects->update
[PASSED QA] Bug 16961: Add Koha::Objects->update

Description Jonathan Druart 2016-07-22 12:55:56 UTC
In order to update several rows in a single query, we need this new method.
Comment 1 Jonathan Druart 2016-07-22 13:00:59 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-07-22 16:07:48 UTC
Created attachment 53655 [details] [review]
[SIGNED-OFF]Bug 16961: Add Koha::Objects->update

In order to update several rows in a single query, we need this new
method.

Test plan:
Confirm that the changes in Objects.t make sense and that the tests
pass.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Test passed successfully
Comment 3 Marcel de Rooy 2016-07-22 16:47:18 UTC
Time for an AUTOLOAD ?
Comment 4 Jonathan Druart 2016-07-22 17:17:52 UTC
(In reply to Marcel de Rooy from comment #3)
> Time for an AUTOLOAD ?

Yes, it's in my todo list :) I have just needed it for bug 16966 and did not want to add a 'big' blocker.
Comment 5 Katrin Fischer 2016-09-18 14:36:49 UTC
Hm, big dependency tree starting here.
Comment 6 Katrin Fischer 2016-09-18 14:43:21 UTC
I am not sure if this line still makes sense... 
Koha::Cities->search( { city_country => 'UK' } )->update( { city_country => 'EU' } );
But the test works :)
Comment 7 Katrin Fischer 2016-09-18 14:45:01 UTC
Created attachment 55654 [details] [review]
[PASSED QA] Bug 16961: Add Koha::Objects->update

In order to update several rows in a single query, we need this new
method.

Test plan:
Confirm that the changes in Objects.t make sense and that the tests
pass.

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

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>
Comment 8 Kyle M Hall 2016-09-27 13:10:32 UTC
Pushed to master for 16.11, thanks Jonathan!