Skip to content

Commit

Permalink
Remove inherited data categories from list
Browse files Browse the repository at this point in the history
  • Loading branch information
melegiul authored and KaydenLiss committed Dec 12, 2023
1 parent 43d8f64 commit f383876
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Repository/VVTDatenkategorieRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class VVTDatenkategorieRepository extends ServiceEntityRepository
{
public function __construct(
ManagerRegistry $registry,
private readonly TeamRepository $teamRepository,
)
{
parent::__construct($registry, VVTDatenkategorie::class);
Expand All @@ -44,14 +43,12 @@ public function add(VVTDatenkategorie $entity, bool $flush = true): void

public function findByTeam(Team $team)
{
$teamPath = $this->teamRepository->getPath($team);

$qb = $this->createQueryBuilder('a');
return $qb
->andWhere('a.team is null OR a.team IN (:teamPath)')
->andWhere('a.team is null OR a.team = :team')
->andWhere($qb->expr()->isNull('a.cloneOf'))
->andWhere('a.activ = 1')
->setParameter('teamPath', $teamPath)
->setParameter('team', $team)
->getQuery()
->getResult();
}
Expand Down

0 comments on commit f383876

Please sign in to comment.