When I want to delete a user, I need NOT to delete from companies. The 2 entities are linked with another which contains user id and company id.
Here is my annotations in the entity in which 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.