vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Form/Type/Customer/CustomerRegistrationType.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\CoreBundle\Form\Type\Customer;
  12. use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
  13. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  14. use Symfony\Component\Form\Extension\Core\Type\TextType;
  15. use Symfony\Component\Form\FormBuilderInterface;
  16. final class CustomerRegistrationType extends AbstractResourceType
  17. {
  18.     public function buildForm(FormBuilderInterface $builder, array $options = []): void
  19.     {
  20.         parent::buildForm($builder$options);
  21.         $builder
  22.             ->add('firstName'TextType::class, [
  23.                 'label' => 'sylius.form.customer.first_name',
  24.             ])
  25.             ->add('lastName'TextType::class, [
  26.                 'label' => 'sylius.form.customer.last_name',
  27.             ])
  28.             ->add('phoneNumber'TextType::class, [
  29.                 'required' => false,
  30.                 'label' => 'sylius.form.customer.phone_number',
  31.             ])
  32.             ->add('subscribedToNewsletter'CheckboxType::class, [
  33.                 'required' => false,
  34.                 'label' => 'sylius.form.customer.subscribed_to_newsletter',
  35.             ])
  36.         ;
  37.     }
  38.     public function getParent(): string
  39.     {
  40.         return CustomerSimpleRegistrationType::class;
  41.     }
  42.     public function getBlockPrefix(): string
  43.     {
  44.         return 'sylius_customer_registration';
  45.     }
  46. }