#6074: Add condition support for model::save
--------------------------+-------------------------------------------------
Reporter: orsonj | Type: Enhancement
Status: new | Priority: Medium
Milestone: 1.3.x.x | Component: Model
Version: 1.2 Final | Severity: Minor
Keywords: | Php_version: n/a
Cake_version: |
--------------------------+-------------------------------------------------
This allows developers to save modified data but only if some condition is
true. One common use would be to store the last modified timestamp when
data is requested to be edited, then supply the saved timestamp as a
condition to prevent overwriting data that was modified between retrieval
and updating. (Also known as a race condition. Commonly prevented with
locks.)
This can be done using model::updateAll, however the developer has to do
some of the work that save would have done
Key points in the model class for implementation:
model::save definition:
http://api.cakephp.org/view_source/model/#line-1093
Add $conditions as an input
model::save execution of an update:
http://api.cakephp.org/view_source/model/#line-1207
Add $conditions to update()
--
Ticket URL: <https://trac.cakephp.org/ticket/6074>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---