I\'m attempting to use Doctrine ORM Associations. I\'ve read several tutorials and the online docs, but it\'s not working, and I\'m honestly not sure what I\'m doing wrong h
The problem is that you are not setting the user entity in your history class. The association stuff does not do this automatically.
class UserHistory
{
public function setUser($user) { $this->user = $user; }
class User
{
public function addHistory($history)
{
$this->history->add($history);
$history->addUser($this); // *** This is what you are missing
}
// In your controller class
$user->addHistory($history);