On Dec 17, 4:28 pm, Jon Price <[email protected]> wrote:
> If you are trying to do conditions as part of the delete command, you
> need deleteAll which accepts an array of conditions in the first
> parameter
> Otherwise do the test before you move on to the delete command. Think
> of delete as deleteById only.
>
I found a bug in my model, I had inadvertently related the users
directly to the images. In the end I used the following code in the
delete function:
$this->Image->recursive = 1;
if (($this->data['Gallery']['user_id'] == $this->Session-
>read('Auth.User.id')) || ($this->_isAdmin())) {
if ($this->Image->delete($id)) {
...
Thanks.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php