예제 #1
0
 /**
  * Set default repository class.
  *
  * @since 2.2
  * @param string $className
  * @throws ORMException If not is a \Doctrine\ORM\EntityRepository
  */
 public function setDefaultRepositoryClassName($className)
 {
     $entityRepositoryClassName = 'Doctrine\\ORM\\EntityRepository';
     if ($className !== $entityRepositoryClassName && !is_subclass_of($className, $entityRepositoryClassName)) {
         throw ORMException::invalidEntityRepository($className);
     }
     $this->_attributes['defaultRepositoryClassName'] = $className;
 }
예제 #2
0
 /**
  * Sets default repository class.
  *
  * @since 2.2
  *
  * @param string $className
  *
  * @return void
  *
  * @throws ORMException If not is a \Doctrine\Common\Persistence\ObjectRepository
  */
 public function setDefaultRepositoryClassName($className)
 {
     $reflectionClass = new \ReflectionClass($className);
     if (!$reflectionClass->implementsInterface('Doctrine\\Common\\Persistence\\ObjectRepository')) {
         throw ORMException::invalidEntityRepository($className);
     }
     $this->_attributes['defaultRepositoryClassName'] = $className;
 }
예제 #3
0
 /**
  * Sets default repository class.
  *
  * @since 2.2
  *
  * @param string $className
  *
  * @return void
  *
  * @throws ORMException If not is a \Doctrine\Common\Persistence\ObjectRepository
  */
 public function setDefaultRepositoryClassName($className)
 {
     $reflectionClass = new \ReflectionClass($className);
     if (!$reflectionClass->implementsInterface(ObjectRepository::class)) {
         throw ORMException::invalidEntityRepository($className);
     }
     $this->_attributes['defaultRepositoryClassName'] = $className;
 }