Browse Source

Fixing doc blocks and faling test

Jose Lorenzo Rodriguez 12 years ago
parent
commit
a3a2685f30

+ 3 - 5
src/ORM/Association/SelectableAssociationTrait.php

@@ -147,7 +147,7 @@ trait SelectableAssociationTrait {
  * which the filter should be applied
  *
  * @param array $options
- * @return string
+ * @return string|array
  */
 	protected abstract function _linkField($options);
 
@@ -170,12 +170,10 @@ trait SelectableAssociationTrait {
 			}
 		}
 
-		$primary = (array)$query->repository()->primaryKey();
-		$foreignKey = (array)$this->foreignKey();
-		$keys = $primary;
+		$keys = (array)$query->repository()->primaryKey();
 
 		if ($this->type() === $this::ONE_TO_ONE) {
-			$keys = $foreignKey;
+			$keys = (array)$this->foreignKey();
 		}
 
 		$filterQuery->join($joins, [], true);

+ 1 - 1
tests/TestCase/ORM/CompositeKeysTest.php

@@ -252,7 +252,7 @@ class CompositeKeyTest extends TestCase {
 		]);
 		$query = new Query($this->connection, $table);
 		$results = $query->select()
-			->where(['id IN' => [1, 2]])
+			->where(['SiteArticles.id IN' => [1, 2]])
 			->contain('SiteAuthors')
 			->hydrate(false)
 			->toArray();