tetranz / select2entity-bundle

A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.
MIT License
218 stars 111 forks source link

Neither the property .... nor one of the methods ... exist and have public access in class "Doctrine\ORM\PersistentCollection" #168

Closed augustomurri closed 4 years ago

augustomurri commented 4 years ago

I don't know if is a bug but cannot use your bundle

$builder
    ->add('codicitag', Select2EntityType::class, [
    'multiple' => false,
    'remote_route' => 'tag_search_json',
    'class' => 'App\Entity\Tag',
    'text_property' => 'codicetag',
    'minimum_input_length' => 2,
    'page_limit' => 10,
    'allow_clear' => true,
    'delay' => 250,
    'placeholder' => 'Select a country'
    ])
    ->add('submit', SubmitType::class);

This throw an error i don't know how to solve

Neither the property "codicetag" nor one of the methods "getCodicetag()", "codicetag()", "isCodicetag()", "hasCodicetag()", "__get()" exist and have public access in class "Doctrine\ORM\PersistentCollection".