Skip to content

Commit

Permalink
CSfix
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed May 11, 2021
1 parent 0acca3e commit c8dc8e1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Repository/RelationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,18 @@ public function findRelations(Content $from, ?string $name, ?int $limit = null,
return [];
}

$result = $this->buildRelationQuery($from, $name, $publishedOnly)
return $this->buildRelationQuery($from, $name, $publishedOnly)
->setMaxResults($limit)
->getQuery()
->getResult();

return $result;
}

public function findFirstRelation(Content $from, ?string $name, bool $publishedOnly = true): ?Relation
{
$result = $this->buildRelationQuery($from, $name, $publishedOnly)
return $this->buildRelationQuery($from, $name, $publishedOnly)
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();

return $result;
}

private function buildRelationQuery(Content $from, ?string $name, bool $publishedOnly = true): QueryBuilder
Expand Down

0 comments on commit c8dc8e1

Please sign in to comment.