date-poll-api/src/Form/PollType.php

36 lines
851 B
PHP
Raw Normal View History

2020-10-26 11:39:04 +01:00
<?php
namespace App\Form;
use App\Entity\Poll;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
2021-04-27 10:22:16 +02:00
class PollType extends AbstractType {
public function buildForm( FormBuilderInterface $builder, array $options ) {
$builder
->add( 'title' )
->add( 'customUrl' )
->add( 'description' )
2021-04-27 12:51:10 +02:00
->add( 'createdAt' )
2021-04-27 10:22:16 +02:00
->add( 'expiracyDate' )
->add( 'kind' )
->add( 'allowedAnswers' )
->add( 'modificationPolicy' )
->add( 'mailOnComment' )
->add( 'mailOnVote' )
->add( 'hideResults' )
->add( 'showResultEvenIfPasswords' )
->add( 'password' )
->add( 'adminKey' )
->add( 'owner' );
}
2020-10-26 11:39:04 +01:00
2021-04-27 10:22:16 +02:00
public function configureOptions( OptionsResolver $resolver ) {
$resolver->setDefaults( [
'data_class' => Poll::class,
] );
}
2020-10-26 11:39:04 +01:00
}