protected function newRepository(ResourceConfiguration $config)
    {
        if ($this->database instanceof EntityManager) {
            return $this->newDoctrineRepository($this->database, $config->getEntityClass(), $config->getParent());
        } elseif ($this->database instanceof PDO) {
            return $this->newPdoRepository($this->database, $config->getResource(), $config->getParent());
        }

        throw new \Exception("Couldn't determine database connection type.");
    }
protected function newRepository(ResourceConfiguration $config)
    {
        if ($this->database instanceof EntityManager) {
            return $this->newDoctrineRepository($this->database, $config->getEntityClass(), $config->getParent());
        } elseif ($this->database instanceof PDO) {
            return $this->newPdoRepository($this->database, $config->getResource(), $config->getParent());
        }

        throw new \Exception("Couldn't determine database connection type.");
    }
protected function newRepository ( ResourceConfiguration $ config ) { if ( $ this -> database instanceof EntityManager ) { return $ this -> newDoctrineRepository ( $ this -> database , $ config -> getEntityClass ( ) , $ config -> getParent ( ) ) ; } elseif ( $ this -> database instanceof PDO ) { return $ this -> newPdoRepository ( $ this -> database , $ config -> getResource ( ) , $ config -> getParent ( ) ) ; } throw new \ Exception ( "Couldn't determine database connection type." ) ; }
Determines which repository to use based on the database connection
that was passed in.

@param string $entityClass
@return ResourceRepositoryInterface
Determines which repository to use based on the database connection that was passed in .