/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('groups', 'sylius_entity_to_identifier', array('label' => 'sylius.form.action.customer_group', 'property' => 'name', 'class' => $this->groupRepository->getClassName(), 'query_builder' => function () { return $this->groupRepository->getFormQueryBuilder(); }, 'constraints' => array(new NotBlank(), new Type(array('type' => 'numeric'))))); }
/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('groups', 'sylius_group_from_identifier', ['label' => 'sylius.form.action.customer_group', 'property' => 'name', 'class' => $this->groupRepository->getClassName(), 'constraints' => [new NotBlank(), new Type(['type' => 'numeric'])]]); }