/** * 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; }
/** * 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; }
/** * 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; }