I would be creating a new action in your controller to handle your
multiple soft delete and you would need to pass a data array
structured as follows:
Array
(
[ModelName] => Array(
[0] => Array
(
[id] => 1
[deleted] => 0
)
[1] => Array
(
[id] => 2
[deleted] => 1
)
)
[2] => Array
(
[id] => 3
[deleted] => 0
)
)
)
In your controller action you can then call something like:
$this->ModelName->saveAll($data['ModelName']);
$this->redirect('index');
Which in the above data array example would set record 2's delete
field to true and then you are passed back to the index which will now
not show record 2 if your pagination conditions are set to ignore
records with a delete value of 1.
The only Cake-y part about this is the format of the data array so you
can use the saveAll() call, the rest of it is standard PHP coding
really, although you can use cake's helpers to make that process
easier to, but you're still just wrapping your index in a form with a
hidden field for each records id and a checkbox for their delete
value.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---