php - Symfony3 / Doctrine - function: adding row with foreign key -
i starting adventure symfony3 (and php) , encountered problem. at moment application supposed allow user crud projects. displaying works fine, have problem creating. i have got 2 tables: users , projects. project table contains project data including project owner id of user. symfony docs managed map both tables: part of "project" entity: /** * @orm\manytoone(targetentity="user", inversedby="projects") * @orm\joincolumn(name="uid", referencedcolumnname="id") */ private $uid; /** * set uid * * @param \appbundle\entity\user $uid * * @return project */ public function setuid(\appbundle\entity\user $uid = null) { $this->uid = $uid; return $this; } /** * uid * * @return \appbundle\entity\user */ public function getuid() { return $this->uid; } part of 'user' entity: private $projects; public function __construct() { $this->projects = new arraycollection(); } at point i...