I'm having trouble with using the model to delete a record.  I know I
could do it in the controller, but there are various reasons why that
would be more awkward, and also I would like to understand why it's
not working.

Here's what I have (not very complex!):

In friend.php (the model):

class Friend extends AppModel {

 var $belongsTo = 'User';

// Save friends list for given user
 function saveFriendsList($friendsarray = null, $userid = null) {

  ... some processing, checking etc ...

   $this->delete($friend['Friend']['id']);

 ... more stuff...
 }

}

I have debugged $friend immediately before the delete line, and it
looks ok - definitely exists and so on.

Am I doing something wrong, or is this something I'm not supposed to
be doing at all?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to