Commit 25956bea authored by zYne's avatar zYne

Refactored the object population algorithm

parent 753e9bd4
......@@ -331,25 +331,10 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
if(empty($row))
continue;
$ids = $this->tables[$key]->getIdentifier();
$emptyID = false;
if(is_array($ids)) {
foreach($ids as $id) {
if($row[$id] == null) {
$emptyID = true;
break;
}
}
} else {
if( ! isset($row[$ids]))
$emptyID = true;
}
$ids = $this->tables[$key]->getIdentifier();
$name = $key;
if($emptyID) {
if($this->isIdentifiable($row, $ids)) {
$pointer = $this->joins[$name];
......@@ -481,6 +466,26 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
}
return $coll;
}
/**
* hasEmptyIdentifier
*
* @param array $row
* @param mixed $ids
* @return boolean
*/
public function isIdentifiable(array $row, $ids) {
$emptyID = false;
if(is_array($ids)) {
foreach($ids as $id) {
if($row[$id] == null)
return true;
}
} else {
if( ! isset($row[$ids]))
return true;
}
return false;
}
/**
* applyInheritance
* applies column aggregation inheritance to DQL / SQL query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment