Sets up the model repository for the relevant model.

@return $this
510975
protected function initializeModelRepository()
    {
        /** @var ModelRepositoryFactoryInterface $factory */
        $factory = app(ModelRepositoryFactoryInterface::class);

        $this->modelRepository = $factory->make($this->modelInformation->modelClass());

        $this->applyRepositoryContext();

        return $this;
    }
226775
public function setModel(Model $model)
    {
        parent::setModel($model);
        $this->setHtmlAttribute('data-value', $this->getModelValue());

        return $this;
    }
726176
protected function setupObject()
    {
        // Clean key from special characters not allowed in constant names
        $this->key = rtrim(preg_replace('/(\W|_)+/', '_', $this->getAttribute("key")), '_');
        $this->className = $this->getAttribute("class");
        $this->pkg = $this->getAttribute("package");
        $this->ancestor = $this->getAttribute("extends");
    }
342517
public function linkMany() {
        $models = func_get_args();

        if (is_array($models[0])) {
            $models = $models[0];
        }

        foreach ($models as $model) {
            $this->link($model);
        }

        return $this;
    }
1364040
public function setModel(IModel $model, $initRepo = true) {
        $this->model = $model;
        if ($initRepo)
            $this->initRepository();
        return $this;
    }
1264637
public function loadModel()
    {
        $modelClassName = $this->namespace . 'Models\Base';

        if (class_exists($modelClassName)) {
            models()->load($modelClassName, strtolower($this->type));
        }
    }
619568
public function build()
    {
        $this->createEntityClassParameter();

        $this->createConfigurationDefinition();

        $this->createMetadataDefinition();
        $this->createManagerDefinition();
        $this->createRepositoryDefinition();
        $this->createOperatorDefinition();

        // TODO search repository service

        $this->createControllerDefinition();

        $this->createFormDefinition();
        $this->createTableDefinition();

        $this->configureTranslations();

        return $this;
    }
557472
public function setModel($model)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');

        if (!is_subclass_of($model, 'Eden\\Model\\Index')) {
            Exeption::i()
                ->setMessage(self::ERROR_NOT_SUB_MODEL)
                ->addVariable($model)
                ->trigger();
        }

        $this->model = $model;

        return $this;
    }
291972
protected function createModel()
    {
        if (! $this->model instanceof LogModel) {
            $this->model = $this->loader->getModels()->createLogModel();
            $this->model->applyDetailSettings();
        }
        return $this->model;
    }
134431
public function setPrimaryModel(Model $model) {
        $this->_model = $model;
        $this->setPrimaryClass(get_class($model));

        return $this;
    }
38125
public function reset()
    {
        $this->controllerResolver->reset();
        $this->repositoryResolver->reset();
        $this->viewResolver->reset();

        return $this;
    }
1193229
public function setModel(Model $model)
    {
        $this->model = $model;
        $append = $this->getAppends();

        if ($append instanceof WithModelInterface) {
            $append->setModel($model);
        }

        return $this;
    }
402798
private function callRepository()
    {
        // check the config
        if (config('generators.settings.controller.repository_contract')) {
            if ($this->confirm("Create a reposity and contract for the $this->resource resource?")) {
                $name = $this->getModelName();

                $this->repositoryContract = true;

                $this->callCommandFile('contract', $name);
                $this->callCommandFile('repository', $name);

                //$contract = $name . config('generators.settings.contract.postfix');
                //$this->callCommandFile('repository', $name, ['--contract' => $contract]);
            }
        }
    }
348734
public function setParameters()
	{		
		//set the url parameter from the UrlParserObjectInstance
		$this->parameters = $this->UrlParserObjectInstance->getParameters();

		//populate the Input Class data
		Input::setGet()->setPost();
		
		//return this object instance
		return $this;

	}
880858
public function addModel($name, Repository $model, $default = null)
    {
        $this->addRepository($name, $model, $default);

        return $this;
    }
517599
public function addRepository($repository)
    {
        $class = $repository->getModelClass();
        if ($this->getByClass($class)) {
            throw new RepositoryException("The manager already contains a repository for the model class '$class'");
        }
        
        $repository->setManager($this);
        $this->repositories[$class] = $repository;
    }
1084584
public function finaliseBuild(): self
    {
        $this->dataTransferObjectsForAllEntitiesAction->run();
        $this->entityFormatter->run();
        $this->copyPhpstormMeta->run();

        return $this;
    }