symfony - Can't load data from inversed side -


i've got these two:

inversed side:

/**  * @orm\onetoone(targetentity="rentorder", mappedby="calendarentry")  */ private $rentorder; 

inversing side (owner):

/**  * @orm\onetoone(targetentity="calendarentry", orphanremoval=true, cascade={"all"}, inversedby="rentorder")      */         private $calendarentry; 

and works:

$rentorder->getcalendarentry(); 

but returns null:

$calendarentry->getrentorder() 

why?

// edit

using "fetch" annotation doesn't change anything.

look @ db scheme, both entites has reference each other. bidirectional relation, save set relation on both sides, example

$rentorder->setcalendarentry($calendarentry); $calendarentry->setrentorder($rentorder); $em->flush(); 

Comments