app/Customize/Form/Type/EntryContactType.php line 28

Open in your IDE?
  1. <?php
  2. namespace Customize\Form\Type;
  3. use Eccube\Common\EccubeConfig;
  4. use Eccube\Entity\Customer;
  5. use Eccube\Form\Type\AddressType;
  6. use Eccube\Form\Type\KanaType;
  7. use Eccube\Form\Type\Master\JobType;
  8. use Eccube\Form\Type\Master\SexType;
  9. use Eccube\Form\Type\NameType;
  10. use Eccube\Form\Type\PhoneNumberType;
  11. use Eccube\Form\Type\PostalType;
  12. use Eccube\Form\Type\RepeatedEmailType;
  13. use Eccube\Form\Type\RepeatedPasswordType;
  14. use Symfony\Component\Form\AbstractType;
  15. use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
  16. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  17. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  18. use Symfony\Component\Form\Extension\Core\Type\TextType;
  19. use Symfony\Component\Form\FormBuilderInterface;
  20. use Symfony\Component\Form\FormError;
  21. use Symfony\Component\Form\FormEvent;
  22. use Symfony\Component\Form\FormEvents;
  23. use Symfony\Component\OptionsResolver\OptionsResolver;
  24. use Symfony\Component\Validator\Constraints as Assert;
  25. class EntryContactType extends AbstractType
  26. {
  27.     /**
  28.      * @var EccubeConfig
  29.      */
  30.     protected $eccubeConfig;
  31.     /**
  32.      * EntryType constructor.
  33.      *
  34.      * @param EccubeConfig $eccubeConfig
  35.      */
  36.     public function __construct(EccubeConfig $eccubeConfig)
  37.     {
  38.         $this->eccubeConfig $eccubeConfig;
  39.     }
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     public function buildForm(FormBuilderInterface $builder, array $options)
  44.     {
  45.         $builder
  46.             ->add('name'NameType::class, [
  47.                 'required' => true,
  48.             ])
  49.             ->add('kana'KanaType::class, [])
  50.             ->add('salon_name'TextType::class, [
  51.                 'required' => true
  52.             ])
  53.             ->add('postal_code'PostalType::class)
  54.             ->add('address'AddressType::class)
  55.             ->add('phone_number'PhoneNumberType::class, [
  56.                 'required' => true,
  57.             ])
  58.             ->add('email'EmailType::class, [
  59.                 'required' => true
  60.             ]);
  61.     }
  62.     /**
  63.      * {@inheritdoc}
  64.      */
  65.     public function configureOptions(OptionsResolver $resolver)
  66.     {
  67.         $resolver->setDefaults([
  68.             'data_class' => 'Customize\Entity\EntryContact',
  69.         ]);
  70.     }
  71.     /**
  72.      * {@inheritdoc}
  73.      */
  74.     public function getBlockPrefix()
  75.     {
  76.         // todo entry,mypageで共有されているので名前を変更する
  77.         return 'entry_contact';
  78.     }
  79. }