Reputation: 2776
In Doctrine there is an interface Doctrine\Common\Persistence\ObjectRepository
.
Can someone explain the role and what are the uses of this interface.
Upvotes: 2
Views: 687
Reputation: 10174
Well, it's not a Class
, it's an Interface
. It's part of the Doctrine Common library
It's implemented the Doctrine ORM library (Doctrine\ORM\EntityRepository
) and by the Doctrine MongoDB Object Document Mapper (Doctrine\ODM\MongoDB\DocumentRepository
).
If you don't want to use Doctrine ORM or MongoDB and write your own ObjectRepository instead, you should implement the interface.
The most common way to write your own EntityRepository (with Doctrine ORM) is to extend Doctrine\ORM\EntityRepository
.
Upvotes: 2