I am working with FOSUserBunde and I want to make a ManytoMany relation on the User entity .
I have seen this post and I have tried to do the same thing .
So this is my code
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", inversedBy="userfriends")
*/
private $users;
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="users")
*/
private $userfriends;
When I run the update database command I got table with user_user
with usertarget
and usersource
My problem is that I want to display all usersfriends
.
Any help please ..