diff --git a/Cake/ORM/Association.php b/Cake/ORM/Association.php index 53340a3f5d9..67d3f2fc707 100644 --- a/Cake/ORM/Association.php +++ b/Cake/ORM/Association.php @@ -424,8 +424,9 @@ protected abstract function _joinCondition(array $options); * required. * * @param Cake\ORM\Entity $entity The entity that started the cascaded delete. + * @param array $options The options for the original delete. * @return boolean Success */ - public abstract function cascadeDelete(Entity $entity); + public abstract function cascadeDelete(Entity $entity, $options = []); } diff --git a/Cake/ORM/Association/BelongsTo.php b/Cake/ORM/Association/BelongsTo.php index 24e03992a36..0f6c28cc243 100644 --- a/Cake/ORM/Association/BelongsTo.php +++ b/Cake/ORM/Association/BelongsTo.php @@ -59,9 +59,10 @@ public function foreignKey($key = null) { * BelongsTo associations are never cleared in a cascading delete scenario. * * @param Cake\ORM\Entity $entity The entity that started the cascaded delete. + * @param array $options The options for the original delete. * @return boolean Success. */ - public function cascadeDelete(Entity $entity) { + public function cascadeDelete(Entity $entity, $options = []) { return true; } diff --git a/Cake/ORM/Association/BelongsToMany.php b/Cake/ORM/Association/BelongsToMany.php index 9a61a893240..c06e6ab10ef 100644 --- a/Cake/ORM/Association/BelongsToMany.php +++ b/Cake/ORM/Association/BelongsToMany.php @@ -222,9 +222,10 @@ public function eagerLoader(array $options) { * Clear out the data in the join/pivot table for a given entity. * * @param Cake\ORM\Entity $entity The entity that started the cascading delete. + * @param array $options The options for the original delete. * @return boolean Success. */ - public function cascadeDelete(Entity $entity) { + public function cascadeDelete(Entity $entity, $options = []) { $foreignKey = $this->foreignKey(); $primaryKey = $this->source()->primaryKey(); $conditions = [ diff --git a/Cake/ORM/Association/DependentDeleteTrait.php b/Cake/ORM/Association/DependentDeleteTrait.php index 8bfe350c8f6..8544db708ab 100644 --- a/Cake/ORM/Association/DependentDeleteTrait.php +++ b/Cake/ORM/Association/DependentDeleteTrait.php @@ -31,9 +31,10 @@ trait DependentDeleteTrait { * This method does nothing if the association is not dependent. * * @param Cake\ORM\Entity $entity The entity that started the cascaded delete. + * @param array $options The options for the original delete. * @return boolean Success. */ - public function cascadeDelete(Entity $entity) { + public function cascadeDelete(Entity $entity, $options = []) { if (!$this->dependent()) { return true; } diff --git a/Cake/ORM/Table.php b/Cake/ORM/Table.php index 5f8629451c4..57754cd899c 100644 --- a/Cake/ORM/Table.php +++ b/Cake/ORM/Table.php @@ -989,7 +989,7 @@ protected function _processDelete($entity, $options) { } foreach ($this->_associations as $assoc) { - $assoc->cascadeDelete($entity); + $assoc->cascadeDelete($entity, $options); } return $success; }