app/Customize/Form/Type/Front/ForgotType.php line 31

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  * 2023/11/29 Pico鈴木 パスワード再発行の時に会員番号を追加
  12.  * 2023/12/11 Pico鈴木 HOST_KONOがNumberTypeで定義されていた不具合対応
  13.  */
  14. //namespace Eccube\Form\Type\Front;
  15. namespace Customize\Form\Type\Front;
  16. use Eccube\Common\EccubeConfig;
  17. use Eccube\Form\Validator\Email;
  18. use Symfony\Component\Form\AbstractType;
  19. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  20. use Symfony\Component\Form\Extension\Core\Type\NumberType;  //追加した項目の為に必要
  21. use Symfony\Component\Form\Extension\Core\Type\TextType;    //追加した項目の為に必要
  22. use Symfony\Component\Form\FormBuilderInterface;
  23. use Symfony\Component\Validator\Constraints as Assert;
  24. /**
  25.  * Class ForgotType
  26.  */
  27. class ForgotType extends AbstractType
  28. {
  29.     /**
  30.      * @var EccubeConfig
  31.      */
  32.     protected $eccubeConfig;
  33.     /**
  34.      * ForgotType constructor.
  35.      *
  36.      * @param EccubeConfig $eccubeConfig
  37.      */
  38.     public function __construct(EccubeConfig $eccubeConfig)
  39.     {
  40.         $this->eccubeConfig $eccubeConfig;
  41.     }
  42.     /**
  43.      * {@inheritdoc}
  44.      */
  45.     public function buildForm(FormBuilderInterface $builder, array $options)
  46.     {
  47.         $builder->add('login_email'EmailType::class, [
  48.             'attr' => [
  49.                 'maxlength' => $this->eccubeConfig['eccube_stext_len'],
  50.             ],
  51.             'constraints' => [
  52.                 new Assert\NotBlank(),
  53.                 new Email(nullnull$this->eccubeConfig['eccube_rfc_email_check'] ? 'strict' null),
  54.             ],
  55.         ])
  56.         ->add('host_kono'TextType::class, [
  57.             'required' => true,
  58.             'constraints' => [
  59.                 new Assert\NotBlank(),
  60.             ],
  61.         ]);
  62.     }
  63.     /**
  64.      * {@inheritdoc}
  65.      */
  66.     public function getBlockPrefix()
  67.     {
  68.         return 'forgot';
  69.     }
  70. }