orm - Symfony 2, Doctrine 2 Multiple one to one relations from one entity to another -


i once more need you. possible implement more 1 onetoone relationship entity?

i have entity called route: in entity have start-variable , end-variable. want both of them onetoone instance of second entity called position.

entity position: in here have id, name, latitude , longitude.

this picture shows better: http://s14.directupload.net/images/140324/36o8vyxm.jpg

is possible, , how implement in doctrine? i´ve tried to give both, start , end, onetoone annotion, doctrine won´t notice changes.

thank help!

simply define fields; problems?

in route entity

/**  * @var string  *  * @orm\onetoone(targetentity="position", cascade={"all"})  * @orm\joincolumn(name="start_position_id", referencedcolumnname="id")  */ private $answerright;  /**  * @var string  *  * @orm\onetoone(targetentity="position", cascade={"all"})  * @orm\joincolumn(name="end_position_id", referencedcolumnname="id")  */ private $answerwrong; 

and in position entity:

 /**  * @orm\onetoone(targetentity="route")  */  private $route; 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -