[Koha-bugs] [Bug 23185] Koha::Objects supports passing through 'update' which means we can side step 'set' + 'store'

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 28 15:45:10 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23185

--- Comment #7 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Agreed with Jonathan that we should default Koha::Objects->update to loop
through the resultset and call Koha::Object->store..  However, we should also
allow for a direct_update option either by adding a direct_update method to
Koha::Objects or by checking for a parameter passed to Koha::Objects->update.

Examples:
Koha::Holds->search({ biblionumber => $hold->biblionumber, priority => { '>' =>
0 } })->update({ priority => \'priority + 1' }, { skip_triggers => 1});

OR

Koha::Holds->search({ biblionumber => $hold->biblionumber, priority => { '>' =>
0 } })->direct_update({ priority => \'priority + 1' });

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list