function let(AttributeTypeRegistry $registry, AddAttributeTypeRelatedFieldsSubscriber $subscriber, FormBuilderInterface $builder) { $registry->getAliases()->willReturn(['text', 'number', 'email']); $registry->getSortedAliases()->willReturn(['text' => 'text', 'number' => 'number', 'email' => 'email']); $this->beConstructedWith($registry, $subscriber, 'Pim\\Bundle\\CatalogBundle\\Entity\\AttributeTranslation', 'Pim\\Bundle\\CatalogBundle\\Entity\\Attribute', 'Pim\\Bundle\\CatalogBundle\\Entity\\AttributeGroup'); }
/** * {@inheritdoc} */ protected function addFieldAttributeType(FormBuilderInterface $builder) { $builder->add('attributeType', 'choice', ['choices' => $this->registry->getSortedAliases(), 'select2' => true, 'disabled' => false, 'read_only' => true]); }
/** * List attributes * * @Template * @AclAncestor("pim_enrich_attribute_index") * * @return Template */ public function indexAction() { return ['attributeTypes' => $this->registry->getSortedAliases()]; }