mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix phpstan errors: undefined variable or type invalid
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
@@ -97,22 +98,6 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository
|
||||
return AccompanyingPeriodWork::class;
|
||||
}
|
||||
|
||||
public function toDelete()
|
||||
{
|
||||
$qb = $this->buildQueryBySocialActionWithDescendants($action);
|
||||
$qb->select('g');
|
||||
|
||||
foreach ($orderBy as $sort => $order) {
|
||||
$qb->addOrderBy('g.' . $sort, $order);
|
||||
}
|
||||
|
||||
return $qb
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($offset)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
private function buildQueryBySocialActionWithDescendants(SocialAction $action): QueryBuilder
|
||||
{
|
||||
$actions = $action->getDescendantsWithThis();
|
||||
@@ -122,9 +107,9 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository
|
||||
$orx = $qb->expr()->orX();
|
||||
$i = 0;
|
||||
|
||||
foreach ($actions as $action) {
|
||||
foreach ($actions as $a) {
|
||||
$orx->add(":action_{$i} MEMBER OF g.socialActions");
|
||||
$qb->setParameter("action_{$i}", $action);
|
||||
$qb->setParameter("action_{$i}", $a);
|
||||
}
|
||||
$qb->where($orx);
|
||||
|
||||
|
Reference in New Issue
Block a user