We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get Model Query with nested relationship

Hi Im using phalcon ORM and I want to get (fr example) all vehicles in my db but I want the relationship nested like the method (with()) do it in Laravel please hope u can help me!

There is eager loading available in incubator if you really want this.



812

There is eager loading available in incubator if you really want this. whats that??? eager loading ??



812
Accepted
answer
edited Jun '19

solved by myself you need to add $vehicles->setHydrateMode( \Phalcon\Mvc\Model\Resultset\Complex::HYDRATE_ARRAYS ); after your query execute.

    and then all your object will be array nested include the relationship

    (very confused , dont like it.)