Skip to content

Commit

Permalink
fix(doctrine): delete useless leftjoin
Browse files Browse the repository at this point in the history
  • Loading branch information
koromerzhin committed Oct 19, 2021
1 parent d78860e commit 29e1d2e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 47 deletions.
6 changes: 1 addition & 5 deletions apps/src/Repository/AdresseUserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin('a.refuser', 'u');
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);
return $this->setQuery($queryBuilder, $get);
}

protected function setQuery(QueryBuilder $query, array $get): QueryBuilder
Expand Down
9 changes: 1 addition & 8 deletions apps/src/Repository/EditoRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin(
'a.refuser',
'u'
);
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);
return $this->setQuery($queryBuilder, $get);
}

public function findOnePublier()
Expand Down
9 changes: 1 addition & 8 deletions apps/src/Repository/EmailUserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin(
'a.refuser',
'u'
);
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);
return $this->setQuery($queryBuilder, $get);
}

public function getEmailsUserVerif(User $user, bool $verif): array
Expand Down
11 changes: 2 additions & 9 deletions apps/src/Repository/LienUserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin(
'a.refuser',
'u'
);
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);

return $this->setQuery($queryBuilder, $get);
}

protected function setQuery(QueryBuilder $query, array $get): QueryBuilder
Expand Down
9 changes: 1 addition & 8 deletions apps/src/Repository/NoteInterneRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin(
'a.refuser',
'u'
);
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);
return $this->setQuery($queryBuilder, $get);
}

public function findPublier()
Expand Down
11 changes: 2 additions & 9 deletions apps/src/Repository/PhoneUserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ public function __construct(ManagerRegistry $registry)
public function findAllForAdmin(array $get): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('a');
$query = $queryBuilder->leftJoin(
'a.refuser',
'u'
);
$query->where(
'u.id IS NOT NULL'
);

return $this->setQuery($query, $get);

return $this->setQuery($queryBuilder, $get);
}

protected function setQuery(QueryBuilder $query, array $get): QueryBuilder
Expand Down

0 comments on commit 29e1d2e

Please sign in to comment.