protected function getRepository()
{
$manager = $this->getManager();
$repository = $manager->getRepository($this->getClass());
if ($repository instanceof Repository) {
return $repository;
}
if ($manager instanceof \Doctrine\ORM\EntityManager) {
return new OrmRepositoryWrapper($repository);
}
if ($manager instanceof \Doctrine\ODM\MongoDB\DocumentManager) {
return new MongoRepositoryWrapper($repository);
}
throw new \RuntimeException("I have no idea what to do with this repository class!");
}