Skip to content

Commit

Permalink
fix(EntityRepository): Support node. order-by keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Sep 14, 2023
1 parent a46157d commit be7c441
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/RoadizCoreBundle/src/Repository/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ public function searchBy(
// Add ordering
foreach ($orders as $key => $value) {
if (
\str_starts_with($key, 'node.') ||
str_contains($key, static::NODE_ALIAS . '.') &&
$this->hasJoinedNode($qb, $alias)
) {
$key = preg_replace('#^node\.#', static::NODE_ALIAS . '.', $key);
$qb->addOrderBy($key, $value);
} elseif (
str_contains($key, static::NODESSOURCES_ALIAS . '.') &&
Expand Down

0 comments on commit be7c441

Please sign in to comment.