Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor getting relations from collection's model

  • Loading branch information...
commit fdd62debbf4bf43a62a9c1a6a084730fdfc16c57 1 parent d3c394b
@Bukarinov Bukarinov authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 library/GeometriaLab/Model/Persistent/Collection.php
View
11 library/GeometriaLab/Model/Persistent/Collection.php
@@ -19,14 +19,13 @@ public function fetchRelations($relationNames = null, $refresh = false)
return $this;
}
- foreach ($relations as $relation) {
- /* @var \GeometriaLab\Model\Persistent\Relation\AbstractRelation $relation */
- $relationNames[$relation->getProperty()->getName()] = null;
- }
- } else {
- $relationNames = $this->parseRelationNames($relationNames);
+ $relationNames = array_map(function($relation) {
+ return null;
+ }, $relations);
}
+ $relationNames = $this->parseRelationNames($relationNames);
+
foreach ($relationNames as $relationName => $childRelations) {
$relation = $this->getRelation($relationName);
if ($relation !== null) {
Please sign in to comment.
Something went wrong with that request. Please try again.