I did some research, and after reading this and this (and all the related questions) I still can\'t figure which is the proper way to update a many to many relationship in S
According to doctrine documentation it will only check the owning side of an association for changes.
http://doctrine-orm.readthedocs.org/en/latest/reference/unitofwork-associations.html
So the best way is keep owning side entity assotiations updated.
In this case you must remove and add support_log in student main in add and remove methods
class support_log
{
/**
* @ORM\ManyToMany(targetEntity="student_main", mappedBy="support_log")
**/
private $student;
public function addStudent($student) {
$this->student[] = $student;
$student->addSupportLog($this);
}
public function removeStudent($student) {
$student->removeSupportLog($this);
$this->student->removeElement($student);
}
Thats all no need to modify controller actions. Important implement this at the inverse side of association!