public function buildForm(FormBuilder $builder, array $options) { if ($options['multiple']) { $builder->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list'])); } else { $builder->prependClientTransformer(new ModelToIdTransformer($options['choice_list'])); } }
public function buildForm(FormBuilder $builder, array $options) { if ($options['multiple']) { $builder->addEventSubscriber(new MergeCollectionListener())->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list'])); } else { $builder->prependClientTransformer(new ModelToIdTransformer($options['choice_list'])); } }
public function buildForm(FormBuilder $builder, array $options) { $builder->prependClientTransformer(new CategoriesCollectionTransformer($options['entityCategoryClass']))->addEventSubscriber(new CategoriesMergeCollectionListener()); $registries = \CategoryRegistryUtil::getRegisteredModuleCategories($options['module'], $options['entity'], 'id'); foreach ($registries as $registryId => $categoryId) { $builder->add('registry_' . $registryId, 'entity', array('class' => 'Zikula\\Core\\Doctrine\\Entity\\Category', 'property' => 'name', 'query_builder' => function (EntityRepository $repo) use($categoryId) { //TODO: (move to)/use own entity repository after CategoryUtil migration return $repo->createQueryBuilder('e')->where('e.parent = :parentId')->setParameter('parentId', (int) $categoryId); })); } }
public function buildForm(FormBuilder $builder, array $options) { if ($options['multiple']) { $builder->prependClientTransformer(new CollectionToArrayTransformer()); } }
public function buildForm(FormBuilder $builder, array $options) { $builder->prependClientTransformer(new ModelToIdTransformer($options['model_manager'], $options['class'])); }
/** * {@inheritdoc} */ public function buildForm(FormBuilder $builder, array $options) { $builder->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list'])); $this->choices = $options['choice_list']->getChoices(); unset($options['choices']); }
public function buildForm(FormBuilder $builder, array $options) { $builder->prependClientTransformer(new OneEntityToIdTransformer($this->registry->getEntityManager($options['em']), $options['class'], $options['property'], $options['query_builder'])); }