src/Form/GameType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Game;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\DateIntervalType;
  6. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. class GameType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options)
  12.     {
  13.         $builder
  14.             ->add('maxTurnTime'DateIntervalType::class, [
  15.                 'label' => "Turn Time",
  16.                 'widget' => 'integer',
  17.                 'with_years' => false,
  18.                 'with_months' => false,
  19.                 'with_days' => false,
  20.                 'with_hours' => false,
  21.                 'with_minutes' => true,
  22.                 'with_seconds' => true,
  23.             ])
  24.             ->add('maxPlayerTime'DateIntervalType::class, [
  25.                 'label' => "Player Time",
  26.                 'widget' => 'integer',
  27.                 'with_years' => false,
  28.                 'with_months' => false,
  29.                 'with_days' => false,
  30.                 'with_minutes' => true,
  31.                 'with_seconds' => true,
  32.             ])
  33.             ->add('isTournamentMatch'null, [
  34.                 'label' => "Tournament match?",
  35.             ])
  36.             ->add('board'BoardType::class)
  37.         ;
  38.     }
  39.     public function configureOptions(OptionsResolver $resolver)
  40.     {
  41.         $resolver->setDefaults([
  42.             'data_class' => Game::class,
  43.         ]);
  44.     }
  45. }