On Jun 10, 11:55 am, WhyNotSmile <[email protected]> wrote:
> 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...
>  }
>
> }
>

Your method param is $friendsarray but you're using $friend. Typo?

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