Browse Source

Fixing some refactoring artifacts

Jose Lorenzo Rodriguez 12 years ago
parent
commit
7cb08b0ccd
2 changed files with 3 additions and 9 deletions
  1. 2 3
      src/ORM/Entity.php
  2. 1 6
      tests/TestCase/ORM/TableTest.php

+ 2 - 3
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 @@ class Entity implements EntityInterface {
 			'markClean' => false,
 			'markNew' => null,
 			'guard' => false,
-			'source' => []
+			'source' => null
 		];
 		$this->_className = get_class($this);
 		$this->set($properties, [

+ 1 - 6
tests/TestCase/ORM/TableTest.php

@@ -2815,12 +2815,7 @@ class TableTest extends \Cake\TestSuite\TestCase {
 		$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([