For HasMany and HasOne associations records will be removed based on
the dependent option. Join table records in BelongsToMany associations
will always be removed. You can use the cascadeCallbacks option
when defining associations to change how associated data is deleted.
### Options
- atomic Defaults to true. When true the deletion happens within a transaction.
- checkRules Defaults to true. Check deletion rules before deleting the record.
### Events
- Model.beforeDelete Fired before the delete occurs. If stopped the delete
will be aborted. Receives the event, entity, and options.
- Model.afterDelete Fired after the delete has been successful. Receives
the event, entity, and options.
- Model.afterDeleteCommit Fired after the transaction is committed for
an atomic delete. Receives the event, entity, and options.
The options argument will be converted into an \ArrayObject instance
for the duration of the callbacks, this allows listeners to modify
the options used in the delete operation.
public delete ( Cake\Datasource\EntityInterface $entity, $options = [] ) | ||
$entity | Cake\Datasource\EntityInterface |