[main] filter user jobs by active jobs

This commit is contained in:
nobohan
2022-05-16 11:49:36 +02:00
parent 380c55698c
commit 8eef073988
2 changed files with 6 additions and 0 deletions

View File

@@ -82,6 +82,11 @@ class UserType extends AbstractType
'choice_label' => function (UserJob $c) {
return $this->translatableStringHelper->localize($c->getLabel());
},
'query_builder' => static function (EntityRepository $er) {
$qb = $er->createQueryBuilder('uj');
$qb->where('uj.active = TRUE');
return $qb;
},
])
->add('mainLocation', EntityType::class, [
'label' => 'Main location',