My relationship is like
Post<HABTM>Tag
When I add a new post and corresponding tags it is saving in posts table and tags table and save the ids of both in posts_tags table. Everything is working fine with cakephp HABTM, but now I want to delete a post. I wrote the code:
$this->Post->delete($id);
this deleted the corresponding post with given id and delete the association in the posts_tags table that also working fine. I want to delete the post and corresponding tags in the tags table and values in the mapping table posts_tags. How we can do this in a single shot? Is there any way? Otherwise tell me any solution..I am confused