vendor/sylius/sylius/src/Sylius/Bundle/CustomerBundle/Form/Type/GenderType.php line 21

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sylius package.
  4.  *
  5.  * (c) Paweł Jędrzejewski
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace Sylius\Bundle\CustomerBundle\Form\Type;
  12. use Sylius\Component\Customer\Model\CustomerInterface;
  13. use Symfony\Component\Form\AbstractType;
  14. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  15. use Symfony\Component\OptionsResolver\OptionsResolver;
  16. final class GenderType extends AbstractType
  17. {
  18.     public function configureOptions(OptionsResolver $resolver): void
  19.     {
  20.         $resolver->setDefaults([
  21.             'choices' => [
  22.                 'sylius.gender.unknown' => CustomerInterface::UNKNOWN_GENDER,
  23.                 'sylius.gender.male' => CustomerInterface::MALE_GENDER,
  24.                 'sylius.gender.female' => CustomerInterface::FEMALE_GENDER,
  25.             ],
  26.             'empty_data' => CustomerInterface::UNKNOWN_GENDER,
  27.         ]);
  28.     }
  29.     public function getParent(): string
  30.     {
  31.         return ChoiceType::class;
  32.     }
  33.     public function getBlockPrefix(): string
  34.     {
  35.         return 'sylius_gender';
  36.     }
  37. }