Feat: Add teamer filter
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\JobProfile;
|
||||
use App\Model\TeamerFilterDto;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class TeamerFilterType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'Name',
|
||||
'required' => false,
|
||||
])
|
||||
->add('dateFrom', DatepickerType::class, [
|
||||
'label' => 'verfügbar ab',
|
||||
])
|
||||
->add('dateTo', DatepickerType::class, [
|
||||
'label' => 'verfügbar bis',
|
||||
])
|
||||
->add('pickupId', BpnPickupType::class, [
|
||||
'label' => 'Buszustieg',
|
||||
'required' => false,
|
||||
])
|
||||
->add('skiLicense', CheckboxType::class, [
|
||||
'label' => 'Skilehrer:innen-Lizenz',
|
||||
'required' => false,
|
||||
])
|
||||
->add('snowboardLicense', CheckboxType::class, [
|
||||
'label' => 'Snowboardlehrer:innen-Lizenz',
|
||||
'required' => false,
|
||||
])
|
||||
->add('jobProfile', EntityType::class, [
|
||||
'label' => 'Job-Profil',
|
||||
'class' => JobProfile::class,
|
||||
'required' => false,
|
||||
'choice_label' => 'name',
|
||||
'query_builder' => function (EntityRepository $repository) {
|
||||
return $repository->createQueryBuilder('job_profile')
|
||||
->orderBy('job_profile.name', 'ASC');
|
||||
},
|
||||
])
|
||||
->add('apply', SubmitType::class, [
|
||||
'label' => 'filtern',
|
||||
])
|
||||
->add('reset', SubmitType::class, [
|
||||
'label' => 'reset',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefaults([
|
||||
'data_class' => TeamerFilterDto::class,
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user