Sylius\Bundle\ResourceBundle\Form\Registry\FormTypeRegistryInterface::has PHP Method

has() public method

public has ( string $identifier, string $typeIdentifier ) : boolean
$identifier string
$typeIdentifier string
return boolean
    public function has($identifier, $typeIdentifier);

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->addEventSubscriber(new AddCodeFormSubscriber())->add('translations', ResourceTranslationsType::class, ['entry_type' => $this->attributeTranslationType, 'label' => 'sylius.form.attribute.translations'])->add('type', AttributeTypeChoiceType::class, ['label' => 'sylius.form.attribute.type', 'disabled' => true]);
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
         $attribute = $event->getData();
         if (!$attribute instanceof AttributeInterface) {
             return;
         }
         if (!$this->formTypeRegistry->has($attribute->getType(), 'configuration')) {
             return;
         }
         $event->getForm()->add('configuration', $this->formTypeRegistry->get($attribute->getType(), 'configuration'), ['auto_initialize' => false, 'label' => 'sylius.form.attribute_type.configuration']);
     });
 }
All Usage Examples Of Sylius\Bundle\ResourceBundle\Form\Registry\FormTypeRegistryInterface::has
FormTypeRegistryInterface