When I want to delete a user, I need NOT to delete from compaines. The 2 entites are linked with another wich contains user id and comppany id.
here is my annotations in the entity in wich i link user and company ( could have done it otherwise but there are some other attributes:
@ORM\ManyToOne(targetEntity="Admin\ManagementBundle\Entity\User", inversedBy="uc", cascade={"persist"})
private $user;
@ORM\ManyToOne(targetEntity="Admin\ManagementBundle\Entity\Company", inversedBy="uc", cascade={"persist"})
private $compani;
When i delete with EmtityManager()->remove($user);
it deletes anything related to this user.
Couldn't find anything that could help me.
Thank you,