|
|
@@ -44,8 +44,7 @@ trait DependentDeleteTrait
|
|
|
$conditions = array_combine($foreignKey, $entity->extract($bindingKey));
|
|
|
|
|
|
if ($this->_cascadeCallbacks) {
|
|
|
- $query = $this->find('all')->where($conditions);
|
|
|
- foreach ($query as $related) {
|
|
|
+ foreach ($this->find()->where($conditions)->toList() as $related) {
|
|
|
$table->delete($related, $options);
|
|
|
}
|
|
|
return true;
|