In my Symfony 3 project, I have a ManyToMany relationship between “users” and “roles”.
It worked, but now I have an error:
Property AppBundle\Entity\Role::$user does not exist
I do not know what I did, probably due to running the command "php bin / console doctrine: mapping: import --force AppBundle xml".
Here is a snippet of a user entity class:
class User implements AdvancedUserInterface, \Serializable {
private $id;
private $roles;
As you can see, there is a relation to the Role object.
The essence of the role, on the other hand, does not contain any correlation information, and it should work in accordance with this article:
https://knpuniversity.com/screencast/symfony2-ep3/many-to-many-relationship
and it worked, and now it doesn’t have a clue why.
, " ManyToMany" Symfony. .