I used doctrine query a user:
$customer = $this->getDoctrine()->getRepository('DemoUserBundle:Customer')->find(1);
But i got the result:
Customer {#1441 ▼ +isInitialized: false -id: 1 -username: null -nickname: null -email: null -salt: null -password: null -roles: null -enabled: null -lastLogin: null -expired: null -expiredAt: null -created: null -modified: null -group: null -ceilphoneCode: null -avatar: null -tasks: null -applications: null -companies: null -creators: null -images: null -company: null -store: Store {#1440 ▶} -realName: null -sex: null -age: null -belongCompany: null -address: null -career: null -relationProducts: null -attributes: null -medias: null -logs: null …2 }
the result is not completed, where are other data of this user? why the isInitialized is false?
I added fetch="EAGER"
to an other entity which called this entity and it is Ok for me.
Try $customer = $this->getDoctrine()->getRepository('DemoUserBundle:Customer')->find(1);
and $customer = $this->getDoctrine()->getRepository('DemoUserBundle:Customer')->find(2);
And you will understand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With