The model class for deleting data CakePHP provides several methods to delete records from the database. Deletedelete (int $ id = null, boolean $ cascade = true); delete a record with $ id. By default, records that depend on deleted records are also deleted. For example, to delete a User record related to many Recipe records (User 'hasbucket' or 'hasandbelongstomany 'Recipes): If $ cascade is set to true, related Recipe records are also deleted (the dependent-value of the model is set to true ). If $ cascade is set to false, the Recipe record is retained after the User is deleted. If the database supports foreign keys and cascading deletion, it will be more dependent on CakePHP cascade. One of the benefits of using Model: delete () cascade features is that it allows you to use behavior and Model callbacks: 1 $ this-> Comment-> delete ($ this-> request-> data ('comment. (id'); you can use beforeDelete and afterDelete that both exist in the model and behavior to mount custom logic to the delete process. For more information, see callback methods. DeleteAlldeleteAll (mixed $ conditions, $ cascade = true, $ callbacks = false) Apart from deleteAll (), it will delete all records that match the provided condition, and delete () basically the same. The $ conditions array is provided as an SQL segment or array. Set the logical value of the condition cascade to true. When a condition is deleted, the dependency record is deleted. Callbacks logic value. If the callback is successful, True is returned. If the callback fails, False is returned. Example: 1 // The condition used for deleting is the same as find (). 2 $ this-> Comment-> deleteAll (array ('comment. spam '=> true), false); If a row with callback and/or cascade is deleted, the row is searched and deleted. This usually results in multiple queries. Note: If the deletion condition is successfully executed but no matching record exists, deleteAll () returns true even if no record is deleted.