Form/Type/EntitySearchType.php
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $repository = $this->om->getRepository($options['entity']);
        $builder
            ->addModelTransformer(
                new ObjectToIdentifierTransformer($repository)
            )
        ;
    }
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $repository = $this->om->getRepository($options['entity']);
        $builder
            ->addModelTransformer(
                new ObjectToIdentifierTransformer($repository)
            )
        ;
    }
{@inheritdoc}