I have a bidirectional association between entity "Task" and entity "User".
"Task" is defined as follows
class Task
{
/**
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="tasks")
*/
private user;
}
And "User" is defined as
class User
{
/**
* @ORM\OneToMany(targetEntity="Task", mappedBy="user")
*/
private $tasks;
}
Accessing relationship from both directions works fine. The problem is that I can't update the "Task" entity once it's defined.
Here is a test case
$task->setStatus(new Status(2))
$em->flush();
What am I doing wrong?
setStatusdo? Why do you think it's problem related to user-task relationship? - Damian Polac