mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Remove usage of setParameters in various filters
This commit is contained in:
parent
efcb903d10
commit
304bf4258b
@ -59,9 +59,10 @@ class UserScopeFilter implements FilterInterface
|
|||||||
->andWhere(
|
->andWhere(
|
||||||
$qb->expr()->in("{$p}_history.scope", ":{$p}_scopes")
|
$qb->expr()->in("{$p}_history.scope", ":{$p}_scopes")
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_scopes" => $data["scopes"],
|
"{$p}_scopes",
|
||||||
]);
|
$data["scopes"],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -51,9 +51,10 @@ class UsersJobFilter implements FilterInterface
|
|||||||
. "AND {$p}_history.job IN ( :{$p}_jobs )"
|
. "AND {$p}_history.job IN ( :{$p}_jobs )"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_jobs" => $data["jobs"],
|
"{$p}_jobs",
|
||||||
]);
|
$data["jobs"]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
|
@ -53,9 +53,10 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
. "AND {$p}_history.scope IN ( :{$p}_scopes )"
|
. "AND {$p}_history.scope IN ( :{$p}_scopes )"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_scopes" => $data["scopes"],
|
"{$p}_scopes",
|
||||||
]);
|
$data["scopes"]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -51,9 +51,10 @@ class ByUserJobFilter implements FilterInterface
|
|||||||
. "AND {$p}_history.job IN ( :{$p}_jobs )"
|
. "AND {$p}_history.job IN ( :{$p}_jobs )"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_jobs" => $data["jobs"],
|
"{$p}_jobs",
|
||||||
]);
|
$data["jobs"],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -53,9 +53,10 @@ class ByUserScopeFilter implements FilterInterface
|
|||||||
. "AND {$p}_history.scope IN ( :{$p}_scopes )"
|
. "AND {$p}_history.scope IN ( :{$p}_scopes )"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_scopes" => $data["scopes"],
|
"{$p}_scopes",
|
||||||
]);
|
$data["scopes"],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -22,13 +22,12 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class JobFilter implements FilterInterface
|
final readonly class JobFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'cal_filter_job';
|
private const PREFIX = 'cal_filter_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected TranslatorInterface $translator,
|
private TranslatableStringHelper $translatableStringHelper
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@ -59,9 +58,10 @@ class JobFilter implements FilterInterface
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
->andWhere($qb->expr()->in("{$p}_history.job", ":{$p}_job"))
|
->andWhere($qb->expr()->in("{$p}_history.job", ":{$p}_job"))
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_job" => $data["job"],
|
"{$p}_job",
|
||||||
]);
|
$data["job"]
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +59,10 @@ class ScopeFilter implements FilterInterface
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
->andWhere($qb->expr()->in("{$p}_history.scope", ":{$p}_scope"))
|
->andWhere($qb->expr()->in("{$p}_history.scope", ":{$p}_scope"))
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_scope" => $data["scope"],
|
"{$p}_scope",
|
||||||
]);
|
$data["scope"]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -72,9 +72,10 @@ class CreatorJobFilter implements FilterInterface
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
->andWhere($qb->expr()->in("{$p}_history.job", ":{$p}_jobs"))
|
->andWhere($qb->expr()->in("{$p}_history.job", ":{$p}_jobs"))
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_jobs" => $data["creator_job"],
|
"{$p}_jobs",
|
||||||
]);
|
$data["creator_job"],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@ -63,11 +63,15 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface
|
|||||||
. "AND {$p}_info.infoDate >= :{$p}_start and {$p}_info.infoDate < :{$p}_end"
|
. "AND {$p}_info.infoDate >= :{$p}_start and {$p}_info.infoDate < :{$p}_end"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter("{$p}_jobs", $data['jobs'])
|
||||||
"{$p}_jobs" => $data['jobs'],
|
->setParameter(
|
||||||
"{$p}_start" => $this->rollingDateConverter->convert($data['start_date']),
|
"{$p}_start",
|
||||||
"{$p}_end" => $this->rollingDateConverter->convert($data['end_date'])
|
$this->rollingDateConverter->convert($data['start_date']),
|
||||||
])
|
)
|
||||||
|
->setParameter(
|
||||||
|
"{$p}_end",
|
||||||
|
$this->rollingDateConverter->convert($data['end_date'])
|
||||||
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,11 +63,15 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface
|
|||||||
. "AND {$p}_info.infoDate >= :{$p}_start AND {$p}_info.infoDate < :{$p}_end"
|
. "AND {$p}_info.infoDate >= :{$p}_start AND {$p}_info.infoDate < :{$p}_end"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->setParameters([
|
->setParameter("{$p}_scopes", $data["scopes"])
|
||||||
"{$p}_scopes" => $data["scopes"],
|
->setParameter(
|
||||||
"{$p}_start" => $this->rollingDateConverter->convert($data["start_date"]),
|
"{$p}_start",
|
||||||
"{$p}_end" => $this->rollingDateConverter->convert($data["end_date"])
|
$this->rollingDateConverter->convert($data["start_date"]),
|
||||||
])
|
)
|
||||||
|
->setParameter(
|
||||||
|
"{$p}_end",
|
||||||
|
$this->rollingDateConverter->convert($data["end_date"])
|
||||||
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,9 +72,10 @@ class UserJobFilter implements FilterInterface
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
->andWhere($qb->expr()->in("{$p}_jobHistory.job", ":{$p}_job"))
|
->andWhere($qb->expr()->in("{$p}_jobHistory.job", ":{$p}_job"))
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_job" => $data["jobs"],
|
"{$p}_job",
|
||||||
])
|
$data["jobs"],
|
||||||
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,9 +72,10 @@ class UserScopeFilter implements FilterInterface
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
->andWhere($qb->expr()->in("{$p}_scopeHistory.scope", ":{$p}_scopes"))
|
->andWhere($qb->expr()->in("{$p}_scopeHistory.scope", ":{$p}_scopes"))
|
||||||
->setParameters([
|
->setParameter(
|
||||||
"{$p}_scopes" => $data["scopes"],
|
"{$p}_scopes",
|
||||||
])
|
$data["scopes"],
|
||||||
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user