app/Plugin/CustomerSupportPro42/Form/Type/Master/ContactPurposeType.php line 19

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the ContactManagement Plugin
  4.  *
  5.  * Copyright (C) 2020 Diezon.
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Plugin\CustomerSupportPro42\Form\Type\Master;
  11. use Doctrine\ORM\EntityRepository;
  12. use Eccube\Form\Type\MasterType;
  13. use Symfony\Component\Form\AbstractType;
  14. use Symfony\Component\OptionsResolver\OptionsResolver;
  15. class ContactPurposeType extends AbstractType
  16. {
  17.     /**
  18.      * {@inheritdoc}
  19.      */
  20.     public function configureOptions(OptionsResolver $resolver)
  21.     {
  22.         $resolver->setDefaults([
  23.             'class' => 'Plugin\CustomerSupportPro42\Entity\Master\ContactPurpose',
  24.             'data_class' => null,
  25.             'expanded' => false,
  26.             'query_builder' => function (EntityRepository $er) {
  27.                 return $er->createQueryBuilder('cp')
  28.                     ->orderBy('cp.id''ASC');
  29.             },
  30.         ]);
  31.     }
  32.     /**
  33.      * {@inheritdoc}
  34.      */
  35.     public function getParent()
  36.     {
  37.         return MasterType::class;
  38.     }
  39.     /**
  40.      * {@inheritdoc}
  41.      */
  42.     public function getBlockPrefix()
  43.     {
  44.         return 'contact_purpose';
  45.     }
  46. }