I have 2 Entities, User and Follower.
/**
* @ORM\Entity
* @ORM\Table(name="users")
*/
class User extends BaseUser
{
/**
* @ORM\OneToMany(targetEntity="Follower", mappedBy="user")
*/
protected $followers;
/**
* @ORM\OneToMany(targetEntity="Follower", mappedBy="follower")
*/
protected $followings;
}
/**
* @ORM\Entity
* @ORM\Table(name="follows")
*/
class Follower
{
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="followers")
*/
protected $user;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="followers")
*/
protected $follower;
}
User have followers ($followers) and followings ($followings).
I'm not sure why, but my dev profiler says:
The mappings AppBundle\Entity\User#followings and AppBundle\Entity\Follower#follower are inconsistent with each other.
The mappings AppBundle\Entity\Follower#follower and AppBundle\Entity\User#followers are inconsistent with each other.
Why they are incosistent and it should be done?