Your user model should define the hasMany relationship to Blog as:
'foreignKey' => 'userId',
See definition of foreignKey at
http://book.cakephp.org/view/78/Associations-Linking-Models-Together#hasMany-82
Enjoy,
John
On Apr 17, 9:35 am, kaushik <[email protected]> wrote:
> It is my code for deleting user :
>
> if ($this->User->del($id,true))
> {
> $this->flash('The User with id: '.$id.' has been deleted.', '../
> users');
> }
>
> I think that it is enough for deleting cascade entries. But it is not
> working. What is the problem?
>
> On Apr 14, 3:35 pm, Braindead <[email protected]> wrote:
>
> > How do you delete the user? You have to set the cascade parameter of
> > the del funtion to true. Otherwise related blog posts won't be
> > deleted.
>
> >http://book.cakephp.org/view/516/Deleting-Data
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---