location admin: add admin crud for location type

This commit is contained in:
nobohan
2021-10-21 16:30:37 +02:00
parent e06a98e70a
commit 92843677f9
7 changed files with 167 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
final class LocationTypeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title', TranslatableStringFormType::class,
[
'label' => 'Name',
])
->add('availableForUsers', ChoiceType::class,
[
'choices' => [
'Yes' => true,
'No' => false
],
'expanded' => true
])
->add('addressRequired', ChoiceType::class,
[
'choices' => [
'optional' => LocationType::STATUS_OPTIONAL,
'required' => LocationType::STATUS_REQUIRED,
'never' => LocationType::STATUS_NEVER,
],
'expanded' => true
])
->add('contactData', ChoiceType::class,
[
'choices' => [
'optional' => LocationType::STATUS_OPTIONAL,
'required' => LocationType::STATUS_REQUIRED,
'never' => LocationType::STATUS_NEVER,
],
'expanded' => true
]);
}
}