dependent Parameter

When deleting records in a "has one" relationship, you may want both sides of the association to be deleted. For example, when a user has one profile and the user is deleted, you may want the associated profile to be deleted also. In these cases, the dependent key allows you to do this easily. By default, it is set to false. Set dependent to true to delete records in both tables when the delete action is run through the associated model.

In the blog you are building, you have no need of a "has one" relationship. We will make use of another important relationship in Cake: "has many."

0 0

Post a comment

  • Receive news updates via email from this site