Browse Source

Merge pull request #5594 from Tietew/3.0_new-entity-source

Set entity source on create empty entity.
Mark Story 11 years ago
parent
commit
dc41c7db32
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/ORM/Table.php

+ 3 - 1
src/ORM/Table.php

@@ -1818,7 +1818,9 @@ class Table implements RepositoryInterface, EventListenerInterface
     {
         if ($data === null) {
             $class = $this->entityClass();
-            return new $class;
+            $entity = new $class;
+            $entity->source($this->alias());
+            return $entity;
         }
         if (!isset($options['associated'])) {
             $options['associated'] = $this->_associations->keys();