On 19 October 2014 16:36, Mathieu Decaffmeyer <[email protected]> wrote:

>
> Hi, the EntityManager provides a method to find an entity:
> find( string $entityName, mixed $identifier, integer $lockMode =
> Doctrine\ORM\LockMode::NONE, integer $lockVersion = null )
> the EntityRepository also provides a find method:
> find( mixed $id, integer $lockMode = Doctrine\ORM\LockMode::NONE, integer
> $lockVersion = null )
>
> But why is there findAll method in the EntityRepository and not in the
> EntityManager (just like the find() method) ?
> e.g. $entityManager->findAll('Product');
>

Looking up data is not a responsibility of the EntityManager: it's a
repository concern.
The `find` method on the EntityManager was just introduced as utility
method.

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