/** * {@inheritDoc} */ public function configureOptions(OptionsResolver $resolver) { $choices = []; foreach ($this->providerPool->getValues() as $alias => $value) { $choices[$alias] = $value->getLabel(); } $resolver->setDefaults(['label' => 'Type of value', 'choices' => $choices]); }
/** * Transforms the provider values into a discriminatorMap * * @return array */ public function getDiscriminatorMap() { $map = array(); foreach ($this->pool->getValues() as $alias => $value) { $map[$alias . 'value'] = $value->getEntity(); } return $map; }