symfony - Some property object are null -
i have problem , of course dont understand :) (and of course im french :)
on table "evenement" have user linked. , when :
$repository = $this->getdoctrine()->getmanager()->getrepository('appbundle:evenement'); $evt = $repository->findonebyid($evt); dump($evt)
all ok, can read evt, when in profiler click on child object "user", property null (except id, usermail, mail, password)
and same thing when :
dump($evt->getuser());
why property not filled ?
thank , sorry english.
it's lazy loading. properties not beeing read db unless need them.
try following:
$repository = $this->getdoctrine()->getmanager()->getrepository('appbundle:evenement'); $evt = $repository->findonebyid($evt); $evt->getuser()->getroles(); // ot whatever properties user has. dump($evt)
in case, dump show property populated.
Comments
Post a Comment