Skip to content

Commit

Permalink
Refactor getting relations from collection's model
Browse files Browse the repository at this point in the history
  • Loading branch information
Bukarinov committed Dec 29, 2012
1 parent d3c394b commit fdd62de
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions library/GeometriaLab/Model/Persistent/Collection.php
Expand Up @@ -19,14 +19,13 @@ public function fetchRelations($relationNames = null, $refresh = false)
return $this; return $this;
} }


foreach ($relations as $relation) { $relationNames = array_map(function($relation) {
/* @var \GeometriaLab\Model\Persistent\Relation\AbstractRelation $relation */ return null;
$relationNames[$relation->getProperty()->getName()] = null; }, $relations);
}
} else {
$relationNames = $this->parseRelationNames($relationNames);
} }


$relationNames = $this->parseRelationNames($relationNames);

foreach ($relationNames as $relationName => $childRelations) { foreach ($relationNames as $relationName => $childRelations) {
$relation = $this->getRelation($relationName); $relation = $this->getRelation($relationName);
if ($relation !== null) { if ($relation !== null) {
Expand Down

0 comments on commit fdd62de

Please sign in to comment.