src/Form/Type/ProvideServicesCollectionType.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\CollectionType;
  5. use Symfony\Component\OptionsResolver\OptionsResolver;
  6. class ProvideServicesCollectionType extends AbstractType
  7. {
  8.     /**
  9.      * @inheritDoc
  10.      */
  11.     public function configureOptions(OptionsResolver $resolver): void
  12.     {
  13.         $resolver->setDefaults([
  14.             'entry_type' => ProvidedServiceType::class,
  15.             'allow_add' => false,
  16.             'allow_delete' => false,
  17.             'delete_empty' => false,
  18.             //'by_reference' => false,
  19.             //'data' => $this->serviceListFetcher->fetchFormChoices(),
  20.             'entry_options' => [
  21.                 'attr' => ['data-content' => 'service'],
  22.             ],
  23.         ]);
  24.     }
  25.     /**
  26.      * @inheritDoc
  27.      */
  28.     public function getBlockPrefix()
  29.     {
  30.         return 'provided_services_collection';
  31.     }
  32.     /**
  33.      * @inheritDoc
  34.      */
  35.     public function getParent()
  36.     {
  37.         return CollectionType::class;
  38.     }
  39. }