Form/Items/EntityItem.php
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $entityClasses = [];
        $metaData = $this->entityManager->getMetadataFactory()->getAllMetadata();

        /** @var ClassMetadata $entityMetaData */
        foreach ($metaData as $entityMetaData) {
            $namespace = $entityMetaData->namespace;
            $isAppNamespace = 'AppBundle\Entity' === $namespace || 'App\Entity' === $namespace;
            $isNotComponent = !strpos($entityMetaData->getName(), 'Component');
            if ($isAppNamespace && $isNotComponent && $entityMetaData->hasField('title')) {
                $className = str_replace($namespace.'\\', '', $entityMetaData->getName());
                $entityClasses[$className] = $entityMetaData->getName();
            }
        }

        $builder->add('entity_class', ChoiceType::class, [
            'label' => 'Entity Class',
            'required' => true,
            'choices' => $entityClasses,
        ]);

        /*$builder->add('choice_label', TextType::class, [
            'label' => 'Choice Label Field',
            'required' => false,
        ]);*/

        $builder->add('placeholder', TextType::class, [
            'label' => 'Placeholder',
            'required' => false,
        ]);

        $builder->add('expanded', CheckboxType::class, [
            'label' => 'Expanded',
            'required' => false,
        ]);

        $builder->add('multiple', CheckboxType::class, [
            'label' => 'Multiple',
            'required' => false,
        ]);
    }
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $entityClasses = [];
        $metaData = $this->entityManager->getMetadataFactory()->getAllMetadata();

        /** @var ClassMetadata $entityMetaData */
        foreach ($metaData as $entityMetaData) {
            $namespace = $entityMetaData->namespace;
            $isAppNamespace = 'AppBundle\Entity' === $namespace || 'App\Entity' === $namespace;
            $isNotComponent = !strpos($entityMetaData->getName(), 'Component');
            if ($isAppNamespace && $isNotComponent && $entityMetaData->hasField('title')) {
                $className = str_replace($namespace.'\\', '', $entityMetaData->getName());
                $entityClasses[$className] = $entityMetaData->getName();
            }
        }

        $builder->add('entity_class', ChoiceType::class, [
            'label' => 'Entity Class',
            'required' => true,
            'choices' => $entityClasses,
        ]);

        /*$builder->add('choice_label', TextType::class, [
            'label' => 'Choice Label Field',
            'required' => false,
        ]);*/

        $builder->add('placeholder', TextType::class, [
            'label' => 'Placeholder',
            'required' => false,
        ]);

        $builder->add('expanded', CheckboxType::class, [
            'label' => 'Expanded',
            'required' => false,
        ]);

        $builder->add('multiple', CheckboxType::class, [
            'label' => 'Multiple',
            'required' => false,
        ]);
    }
{@inheritdoc}