Create an instance of the repository class for given $modelName.

@param string $modelName

@return \Parable\ORM\Repository
@throws \Parable\ORM\Exception
12412
public static function createForModelName($modelName)
    {
        if (!class_exists($modelName)) {
            throw new \Parable\ORM\Exception("Model '{$modelName}' does not exist.");
        }
        return self::createForModel($modelName::create());
    }
658742
public static function createRow($modelName, $data): RowInterface
    {
        $tableClass = self::getModelClass($modelName);

        /* @var Table $tableClass name */
        return $tableClass::getInstance()::create($data);
    }
1008333
public function resolveModel($collectionName)
    {
        if (!array_key_exists($collectionName, $this->map)) {
            throw new CannotResolveModelException($collectionName);
        }
        $modelClassName = $this->map[$collectionName];
        try {
            if (!array_key_exists($modelClassName, $this->modelInstances)) {
                $reflectionClass = new \ReflectionClass($modelClassName);
                $modelInstance = $reflectionClass->newInstance();
                $this->modelInstances[$modelClassName] = $modelInstance;
            }
            return $this->modelInstances[$modelClassName];
        } catch (\Exception $e) {
            throw new CannotResolveModelException($collectionName);
        }
    }
727792
public function getNormalizer($modelName) {
		if ($this->models->has($modelName)
				&& $this->models->get($modelName)->has('normalizer')) {
			return $this->models->get($modelName)->get('normalizer');
		}
		return new Map();
	}
233945
public function updateOptions($modelName)
    {
        $fieldFactory = app('admin_field_factory');
        $response     = array();

        //iterate over the supplied constrained fields
        foreach ($this->request->input('fields', array()) as $field) {
            //get the constraints, the search term, and the currently-selected items
            $constraints   = array_get($field, 'constraints', array());
            $term          = array_get($field, 'term', array());
            $type          = array_get($field, 'type', false);
            $fieldName     = array_get($field, 'field', false);
            $selectedItems = array_get($field, 'selectedItems', false);

            $response[$fieldName] = $fieldFactory->updateRelationshipOptions($fieldName, $type, $constraints, $selectedItems, $term);
        }

        return response()->json($response);
    }
63790
protected function createRepository(DocumentManagerInterface $dm, $documentName)
    {
        $metadata = $dm->getClassMetadata($documentName);
        $repositoryClassName = $metadata->customRepositoryClassName;

        if ($repositoryClassName === null) {
            $configuration = $dm->getConfiguration();
            $repositoryClassName = $configuration->getDefaultRepositoryClassName();
        }

        return new $repositoryClassName($dm, $metadata);
    }
359662
public function get($modelName)
    {
        $modelNamespace = Configuration::read('mvc.model.namespace');
        $modelNamespace = $modelNamespace . '\\' . ucFirst($modelName);
        if (!class_exists($modelNamespace)) {
            trigger_error('Model "' . $modelNamespace . '" doesn\'t exist.', E_USER_ERROR);
            return false;
        }
        return new $modelNamespace();
    }
59044
public function setDefaultRepositoryClassName($className)
    {
        $reflectionClass = new \ReflectionClass($className);

        if ( ! $reflectionClass->implementsInterface('Doctrine\Common\Persistence\ObjectRepository')) {
            throw ORMException::invalidEntityRepository($className);
        }

        $this->_attributes['defaultRepositoryClassName'] = $className;
    }
280498
public function modelFactory($modelName) {
        $modelClass = "\\Modules\\" . RouteController::$currentRoute['module'] . "\\Models\\" . $modelName;

        if (class_exists($modelClass)) {
            return new $modelClass(RouteController::$currentRoute);
        } elseif (class_exists("\\Base\\models\\" . $modelName)) {
            $baseModelClass = "\\Base\\models\\" . $modelName;
            return new $baseModelClass(RouteController::$currentRoute);
        } else {
            HookManager::call("handleModel", $modelName);
        }
    }
551722
private function getModelConfiguration($modelName)
    {
        if (!isset($this->annotationCache[$modelName])) {
            $reflection = new \ReflectionClass($modelName);
            $comment    = $reflection->getDocComment();
            $this->annotationCache[$modelName] = $this->parser->parse($comment);
        }

        $configuration = $this->annotationCache[$modelName];
        return $configuration;
    }
313404
public function setModelName($modelName) {
    
    if (!class_exists($modelName))
      throw new Exception("Model '{$modelName}' could not be found");
    
    $model = new \ReflectionClass($modelName);
    
    if (!$model->implementsInterface('\Phalcon\Mvc\ModelInterface'))
      throw new Exception("'{$modelName}' must be an instance of Phalcon\Mvc\ModelInterface");
    
    $this->modelname = $modelName;
    return $this;
  }
872195
public static function set($actionName, $modelType) {
        if (empty($actionName)) {
            throw new \Exception('$actionName must not be empty.');
        }

        if (empty($modelType)) {
            throw new \Exception('$modelType must not be empty.');
        }

        $canUse = false;

        if ($actionName !== '.') {
            if (!is_array($actionName)) {
                $actionName = array($actionName);
            }

            foreach ($actionName as $action) {
                if (self::$actionContext->actionNameEquals($action)) {
                    $canUse = true;
                    break;
                }
            }
        }
        else {
            $canUse = true;
        }

        if (!$canUse) {
            return;
        }

        if (is_object($modelType)) {
            $modelType = get_class($modelType);
        }

        self::$modelType = $modelType;
    }
496637
protected function generateQueryClassName($modelClassName)
    {
        $queryClassName = $this->queryClass;
        if (empty($queryClassName) || strpos($this->tableName, '*') !== false) {
            $queryClassName = $modelClassName . 'Query';
        }
        return $queryClassName;
    }
673170
public function fetchModelFromProvider($modelId, $providerName = null)
    {
        // @codingStandardsIgnoreStart
        @\trigger_error(
            'Use \ContaoCommunityAlliance\DcGeneral\Controller\ModelCollector::getModel()',
            E_USER_DEPRECATED
        );
        // @codingStandardsIgnoreEnd

        return $this->modelCollector->getModel($modelId, $providerName);
    }
1251311
protected function replaceResource($modelName)
    {
        $this->stub = str_replace('{{resource_lw}}', strtolower($modelName), $this->stub);
        $this->stub = str_replace('{{resource}}', $modelName, $this->stub);

        return $this;
    }
408064
protected function replaceClassName($modelName)
    {
        $this->stub = str_replace('{{class_name}}', $modelName, $this->stub);
        $this->stub = str_replace('{{class_name_lw}}', strtolower($modelName), $this->stub);

        return $this;
    }
560459
public function getRepository(EntityManagerInterface $entityManager, $className) {
		if(!isset($this->repositories[$className])) {
			$this->repositories[$className] = $this->generateRepository($entityManager, $className);
		}
		return $this->repositories[$className];
	}