src/MDS/GreenPatioBundle/Form/ReservationLoungeType.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\MDS\GreenPatioBundle\Form;
  3. use App\MDS\GreenPatioBundle\Entity\ReservationLounge;
  4. use App\MDS\GreenPatioBundle\Entity\ReservationLoungeDetails;
  5. use App\MDS\GreenPatioBundle\Entity\ReservationLoungeProfile;
  6. use Symfony\Component\Form\AbstractType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  12. use Symfony\Component\Form\Extension\Core\Type\TextType;
  13. use Symfony\Component\Form\Extension\Core\Type\DateType;
  14. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  15. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  16. class ReservationLoungeType extends AbstractType
  17. {
  18.     /**
  19.      * {@inheritdoc}
  20.      */
  21.     public function buildForm(FormBuilderInterface $builder, array $options)
  22.     {
  23.         $builder
  24.             ->add('loungeName')
  25.             ->add('type'ChoiceType::class, array(
  26.                 'required' => false,
  27.                 'choices' => array(
  28.                     'Montaje' => 'Montaje',
  29.                     'Desmontaje' => 'Desmontaje'
  30.                 ), 'placeholder' => 'Seleccione el tipo'))
  31. //            ->add('idLounge')
  32.             ->add('idLounge'EntityType::class, array(
  33.                 'class' => ReservationLoungeDetails::class,
  34.                 'choice_label' => 'name',
  35.                 'choice_value' => 'id',
  36.                 'expanded' => false,
  37.                 'multiple' => false,
  38.                 'placeholder' => 'Seleccione una sala'))
  39. //            ->add('idPeriod', EntityType::class, array(
  40. //                'class' => ReservationPeriod::class,
  41. //                'choice_label' => 'name',
  42. //                'choice_value' => 'id',
  43. //                'expanded' => false,
  44. //                'multiple' => false,
  45. //                'placeholder' => 'Seleccione una jornada'))
  46.             ->add('otherPriceSave'EntityType::class, array(
  47.                 'class' => ReservationLoungeProfile::class,
  48.                 'choice_label' => 'description',
  49.                 'choice_value' => 'id',
  50.                 'expanded' => false,
  51.                 'multiple' => false,
  52.                 'placeholder' => 'Seleccione una jornada'))
  53.             ->add('dateStart'DateType::class, array(
  54.                 'widget' => 'single_text',
  55.                 'format' => 'yyyy-MM-dd',
  56.             ))
  57.             ->add('hourStart'TextType::class)
  58. //            ->add('minStart', TextType::class)
  59. //            ->add('dateEnd', DateType::class, array(
  60. //                'widget' => 'single_text',
  61. //                'format' => 'yyyy-MM-dd',
  62. //            ))
  63.             ->add('hourEnd'TextType::class)
  64. //            ->add('minEnd', TextType::class)
  65.             ->add('idService')
  66. //            ->add('serviceName')
  67.             ->add('mounting'ChoiceType::class, array(
  68.                 'required' => false,
  69.                 'choices' => array(
  70.                     'Escuela' => 'Escuela',
  71.                     'Teatro' => 'Teatro',
  72.                     'Coctel' => 'Coctel',
  73.                     'Banquete' => 'Banquete',
  74.                     'Imperial' => 'Imperial',
  75.                     'Montaje en U' => 'Montaje en U',
  76.                     'Cabaret' => 'Cabaret'
  77.                 ) ))
  78. //            ->add('mountingDate', DateType::class, array(
  79. //                'widget' => 'single_text',
  80. //                'format' => 'yyyy-MM-dd',
  81. //            ))
  82. //            ->add('mountingHourStart', TextType::class)
  83. //            ->add('mountingMinStart', TextType::class)
  84. //            ->add('mountingHourEnd', TextType::class)
  85. //            ->add('mountingMinEnd', TextType::class)
  86.             ->add('pax'IntegerType::class)
  87.             ->add('servicePrice'IntegerType::class)
  88.             ->add('idReservation')
  89. //            ->add('createdAt')
  90. //            ->add('createdBy')
  91. //            ->add('otherPriceSave')
  92. //            ->add('updatedAt')
  93. //            ->add('updatedBy')
  94.         ->add('save'SubmitType::class);
  95.     }
  96.     
  97.     /**
  98.      * {@inheritdoc}
  99.      */
  100.     public function configureOptions(OptionsResolver $resolver)
  101.     {
  102.         $resolver->setDefaults(array(
  103.             'data_class' => ReservationLounge::class
  104.         ));
  105.     }
  106.     /**
  107.      * {@inheritdoc}
  108.      */
  109.     public function getBlockPrefix()
  110.     {
  111.         return 'mds_greenpatiobundle_reservationlounge';
  112.     }
  113. }