Skip to content

Commit

Permalink
fix: Missing RealmRepository::findByNodeWithSerializationGroup method
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jul 2, 2024
1 parent 67a825d commit aac6e4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/RoadizCoreBundle/src/Repository/RealmRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ public function findByNodeAndBehaviour(Node $node, string $realmBehaviour): arra
return $qb->getQuery()->getResult();
}

public function findByNodeWithSerializationGroup(Node $node): array
{
$qb = $this->createQueryBuilder('r');
$qb->innerJoin('r.realmNodes', 'rn')
->andWhere($qb->expr()->in('rn.node', ':node'))
->andWhere($qb->expr()->isNotNull('rn.realm'))
->andWhere($qb->expr()->isNotNull('r.serializationGroup'))
->setParameter('node', $node);

return $qb->getQuery()->setCacheable(true)->getResult();
}

public function countWithSerializationGroup(): int
{
$qb = $this->createQueryBuilder('r');
Expand Down

0 comments on commit aac6e4e

Please sign in to comment.