Lemon\RestBundle\Object\Manager::getRepository PHP Method

getRepository() protected method

protected getRepository ( ) : Lemon\RestBundle\Object\Repository
return Lemon\RestBundle\Object\Repository
    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!");
    }