From: Raphaƫl Gertz Date: Thu, 29 Feb 2024 14:05:52 +0000 (+0100) Subject: Use entity full namespace instead of dropped entity short syntax X-Git-Tag: 0.3.0~32 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/acd9c442bc1f763742246c210e1659a4c444aca6 Use entity full namespace instead of dropped entity short syntax --- diff --git a/Form/ApplicationType.php b/Form/ApplicationType.php index 40877eb..cee09db 100644 --- a/Form/ApplicationType.php +++ b/Form/ApplicationType.php @@ -37,16 +37,16 @@ class ApplicationType extends AbstractType { $form = $builder; //Add dance field - $form->add('dance', EntityType::class, ['class' => 'RapsysAirBundle:Dance', 'choices' => $options['dance_choices'], 'preferred_choices' => $options['dance_favorites'], 'attr' => ['placeholder' => 'Your dance'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your dance'])], 'data' => $options['dance_default']]); + $form->add('dance', EntityType::class, ['class' => 'Rapsys\AirBundle\Entity\Dance', 'choices' => $options['dance_choices'], 'preferred_choices' => $options['dance_favorites'], 'attr' => ['placeholder' => 'Your dance'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your dance'])], 'data' => $options['dance_default']]); //Add date field $form->add('date', DateType::class, ['attr' => ['placeholder' => 'Your date', 'class' => 'date'], 'html5' => true, 'input' => 'datetime', 'widget' => 'single_text', 'format' => 'yyyy-MM-dd', 'data' => new \DateTime('+7 day'), 'constraints' => [new NotBlank(['message' => 'Please provide your date']), new Type(['type' => \DateTime::class, 'message' => 'Your date doesn\'t seems to be valid'])]]); //Add location field - $form->add('location', EntityType::class, ['class' => 'RapsysAirBundle:Location', 'choices' => $options['location_choices'], 'preferred_choices' => $options['location_favorites'], 'attr' => ['placeholder' => 'Your location'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your location'])], 'data' => $options['location_default']]); + $form->add('location', EntityType::class, ['class' => 'Rapsys\AirBundle\Entity\Location', 'choices' => $options['location_choices'], 'preferred_choices' => $options['location_favorites'], 'attr' => ['placeholder' => 'Your location'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your location'])], 'data' => $options['location_default']]); //Add slot field - $form->add('slot', EntityType::class, ['class' => 'RapsysAirBundle:Slot', 'attr' => ['placeholder' => 'Your slot'], 'constraints' => [new NotBlank(['message' => 'Please provide your slot'])], 'choice_translation_domain' => true, 'data' => $options['slot_default']]); + $form->add('slot', EntityType::class, ['class' => 'Rapsys\AirBundle\Entity\Slot', 'attr' => ['placeholder' => 'Your slot'], 'constraints' => [new NotBlank(['message' => 'Please provide your slot'])], 'choice_translation_domain' => true, 'data' => $options['slot_default']]); //Add extra user field if (!empty($options['user'])) { diff --git a/Form/RegisterType.php b/Form/RegisterType.php index 06e5f36..199e3d9 100644 --- a/Form/RegisterType.php +++ b/Form/RegisterType.php @@ -67,7 +67,7 @@ class RegisterType extends BaseRegisterType { parent::configureOptions($resolver); //Set defaults - $resolver->setDefaults(['city' => true, 'country' => true, 'country_class' => 'RapsysAirBundle:Country', 'country_default' => null, 'country_favorites' => [], 'phone' => true, 'pseudonym' => true, 'zipcode' => true]); + $resolver->setDefaults(['city' => true, 'country' => true, 'country_class' => 'Rapsys\AirBundle\Entity\Country', 'country_default' => null, 'country_favorites' => [], 'phone' => true, 'pseudonym' => true, 'zipcode' => true]); //Add extra city option $resolver->setAllowedTypes('city', 'boolean'); diff --git a/Form/SessionType.php b/Form/SessionType.php index b42b26a..ef42649 100644 --- a/Form/SessionType.php +++ b/Form/SessionType.php @@ -55,10 +55,10 @@ class SessionType extends AbstractType { if (!empty($options['admin'])) { $builder //Add dance field - ->add('dance', EntityType::class, ['class' => 'RapsysAirBundle:Dance', 'choices' => $options['dance_choices'], 'preferred_choices' => $options['dance_favorites'], 'attr' => ['placeholder' => 'Your dance'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your dance'])], 'data' => $options['dance_default']]) + ->add('dance', EntityType::class, ['class' => 'Rapsys\AirBundle\Entity\Dance', 'choices' => $options['dance_choices'], 'preferred_choices' => $options['dance_favorites'], 'attr' => ['placeholder' => 'Your dance'], 'choice_translation_domain' => true, 'constraints' => [new NotBlank(['message' => 'Please provide your dance'])], 'data' => $options['dance_default']]) //Add slot field - ->add('slot', EntityType::class, ['class' => 'RapsysAirBundle:Slot', 'attr' => ['placeholder' => 'Your slot'], 'constraints' => [new NotBlank(['message' => 'Please provide your slot'])], 'choice_translation_domain' => true, 'data' => $options['slot_default']]) + ->add('slot', EntityType::class, ['class' => 'Rapsys\AirBundle\Entity\Slot', 'attr' => ['placeholder' => 'Your slot'], 'constraints' => [new NotBlank(['message' => 'Please provide your slot'])], 'choice_translation_domain' => true, 'data' => $options['slot_default']]) //Add date field ->add('date', DateType::class, ['attr' => ['placeholder' => 'Your date', 'class' => 'date'], 'html5' => true, 'input' => 'datetime', 'widget' => 'single_text', 'format' => 'yyyy-MM-dd', 'data' => $options['date'], 'constraints' => [new NotBlank(['message' => 'Please provide your date']), new Type(['type' => \DateTime::class, 'message' => 'Your date doesn\'t seems to be valid'])]]); }