Nextras\Orm\Bridges\NetteDI\OrmExtension::getRepositoryList PHP Метод

getRepositoryList() защищенный Метод

protected getRepositoryList ( $modelClass )
    protected function getRepositoryList($modelClass)
    {
        $modelReflection = new ClassType($modelClass);
        $builder = $this->getContainerBuilder();
        $builder->addDependency($modelReflection->getFileName());
        $repositories = [];
        foreach ($modelReflection->getAnnotations() as $key => $annotations) {
            if ($key !== 'property-read') {
                continue;
            }
            foreach ($annotations as $annotation) {
                list($class, $name) = preg_split('#\\s+#', $annotation);
                $class = AnnotationsParser::expandClassName($class, $modelReflection);
                if (!class_exists($class)) {
                    throw new RuntimeException("Repository '{$class}' does not exist.");
                }
                $repositories[ltrim($name, '$')] = $class;
            }
        }
        return $repositories;
    }

Usage Example

Пример #1
0
 protected function getRepositoryList($model) : array
 {
     return parent::getRepositoryList($model) + $this->config['repositories'];
 }