original_string: 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.");
      }
code: 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.");
      }
code_tokens: 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." ) ; }
docstring: Determines which repository to use based on the database connection
  that was passed in.
  
  @param string $entityClass
  @return ResourceRepositoryInterface
docstring_tokens: Determines which repository to use based on the database connection that was passed in .