On 21 October 2014 14:25, Nima Sadjadi <[email protected]> wrote:

> find is used for lazy load. CreateQuery is eager load. I don't know if
> this is relevant but i don't think createQuery is shortcut. Marco will
> correct me if I am wrong.
>

These are completely unrelated concepts, and also, `find` is not lazy :-)


Anyway, `createQuery` is indeed a shortcut: as per
https://github.com/doctrine/doctrine2/blob/6fc6d18882f2b8c16c49a1d7dbd67eab6f111a5c/lib/Doctrine/ORM/AbstractQuery.php#L166,
you can just do:

    $query = new Doctrine\ORM\Query($entityManager);

    $query->setDQL('SELECT f FROM Foo f');

Same goes for the QueryBuilder.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to