/** * @Solr\Field(type="strings", getter="getName") * * @ORM\ManyToMany(targetEntity="App\Entity\Vocabulary\Classificator") * @ORM\JoinTable(name="object_classificator_district", * joinColumns={@ORM\JoinColumn(name="object_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="classificator_id", referencedColumnName="id")} * ) */ private $districts; And I get the following error during population: A error occurs: No method "getName()" found in class "Doctrine\ORM\PersistentCollection" How to index ManyToMany in Symfony 4?