Browse Source

Implemented the select strategy for HasOne

Jose Lorenzo Rodriguez 12 years ago
parent
commit
dbe42f98d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ORM/Association/HasOne.php

+ 1 - 1
src/ORM/Association/HasOne.php

@@ -186,7 +186,7 @@ class HasOne extends Association {
  */
 	protected function _buildResultMap($fetchQuery, $options) {
 		$resultMap = [];
-		$key = (array)$this->target()->primaryKey();
+		$key = (array)$options['foreignKey'];
 
 		foreach ($fetchQuery->all() as $result) {
 			$values = [];