Browse Source

Repeating previous fix for HasMany associations.

This makes appveyor happy
Jose Lorenzo Rodriguez 10 years ago
parent
commit
c8ccdf5829
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/ORM/Association/DependentDeleteTrait.php

+ 1 - 2
src/ORM/Association/DependentDeleteTrait.php

@@ -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;