diff --git a/src/ORM/Entity.php b/src/ORM/Entity.php index 62920e39233..4ae822bdbbb 100644 --- a/src/ORM/Entity.php +++ b/src/ORM/Entity.php @@ -43,8 +43,7 @@ class Entity implements EntityInterface { * - markClean: whether to mark all properties as clean after setting them * - markNew: whether this instance has not yet been persisted * - guard: whether to prevent inaccessible properties from being set (default: false) - * - source: An array containing the 'alias' and 'className' keys, describing the - * repository this entity came from. + * - source: A string representing the alias of the repository this entity came from */ public function __construct(array $properties = [], array $options = []) { $options += [ @@ -52,7 +51,7 @@ public function __construct(array $properties = [], array $options = []) { 'markClean' => false, 'markNew' => null, 'guard' => false, - 'source' => [] + 'source' => null ]; $this->_className = get_class($this); $this->set($properties, [ diff --git a/tests/TestCase/ORM/TableTest.php b/tests/TestCase/ORM/TableTest.php index a1140f38646..0ee0e7cf89e 100644 --- a/tests/TestCase/ORM/TableTest.php +++ b/tests/TestCase/ORM/TableTest.php @@ -2815,12 +2815,7 @@ public function testLinkBelongsToMany() { $table = TableRegistry::get('articles'); $table->belongsToMany('tags'); $tagsTable = TableRegistry::get('tags'); - $source = [ - 'source' => [ - 'alias' => 'tags', - 'className' => 'TestApp\Model\Table\TagsTable' - ] - ]; + $source = ['source' => 'tags']; $options = ['markNew' => false]; $article = new \Cake\ORM\Entity([