Get the multi-model persister instance for the given multi-model name.

@param string $modelName

@return ModelPersister
768587
public function getModelPersister($modelName)
    {
        if (!isset($this->persisters[$modelName])) {
            $class = $this->manager->getClassMetadata($modelName);

            $this->persisters[$modelName] = new ModelPersister($this->manager, $this, $class);
        }

        return $this->persisters[$modelName];
    }
381887
public static function getModel($modelName, $uniqueIdentifier = null)
    {
        $class = self::getModelClass($modelName);
        $model = new $class($uniqueIdentifier);

        return $model;
    }
927648
public function customModelAction($modelName)
	{
		$config = app('itemconfig');
		$actionFactory = app('admin_action_factory');
		$actionName = $this->request->input('action_name', false);
		$dataTable = app('admin_datatable');

		//get the sort options and filters
		$page = $this->request->input('page', 1);
		$sortOptions = $this->request->input('sortOptions', array());
		$filters = $this->request->input('filters', array());

		//get the prepared query options
		$prepared = $dataTable->prepareQuery(app('db'), $page, $sortOptions, $filters);

		//get the action and perform the custom action
		$action = $actionFactory->getByName($actionName, true);
		$result = $action->perform($prepared['query']);

		//if the result is a string, return that as an error.
		if (is_string($result))
		{
			return response()->json(array('success' => false, 'error' => $result));
		}
		//if it's falsy, return the standard error message
		else if (!$result)
		{
			$messages = $action->getOption('messages');

			return response()->json(array('success' => false, 'error' => $messages['error']));
		}
		else
		{
			$response = array('success' => true);

			//if it's a download response, flash the response to the session and return the download link
			if (is_a($result, 'Symfony\Component\HttpFoundation\BinaryFileResponse'))
			{
				$file = $result->getFile()->getRealPath();
				$headers = $result->headers->all();
				$this->session->put('administrator_download_response', array('file' => $file, 'headers' => $headers));

				$response['download'] = route('admin_file_download');
			}
			//if it's a redirect, put the url into the redirect key so that javascript can transfer the user
			else if (is_a($result, '\Illuminate\Http\RedirectResponse'))
			{
				$response['redirect'] = $result->getTargetUrl();
			}

			return response()->json($response);
		}
	}
1218708
protected function getRepository($persistentObjectName, $persistentManagerName = null)
    {
        return $this->getContainer()->get('doctrine')->getRepository($persistentObjectName, $persistentManagerName);
    }
382165
public function getShared($objectName)
    {
        if ($this->instantiated->has($objectName)) {
            return $this->instantiated->get($objectName);
        }
        
        throw new NotFoundException('Shared object with name: ":name" was not found', ['name' => $objectName]);
    }
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);
        }
    }
376461
public function hasMany($name, $foreignKey, $modelName = null)
    {
        $this->addAssociation('hasMany', $name, $foreignKey, $modelName);
        return $this;
    }
1273354
public function getManagedModel()
    {
        if (!isset($this->managedModel) || $this->managedModel === null) {
            throw new ModelAdminException('You have a ModelAdmin which does not have a model assigned to it. ModelAdmins must include a model to manage.', 1);
        }

        return $this->managedModel;
    }
1216136
public function getModelJoinByTableName($tableName) {
        foreach ($this->joins as $join) {
            if ($join instanceof ModelJoin && $join->getTableMap()->getName() == $tableName) {
                return $join;
            }
        }

        return null;
    }
424829
public function getModelVersion($className) {
        $version = '1.0';
        $className= $this->loadClass($className);
        if ($className && isset($this->map[$className]['version'])) {
            $version= $this->map[$className]['version'];
        }
        return $version;
    }
866180
public <M extends Model> Persister<M> withPersister(String server) {
        Persister<M> persister = _getPersister(server);
        if (persister == null) {
            throw new NotPersisterFindException();
        }
        return persister;
    }
492120
public function getFeature($featureName, $permissive = false) {
        $feature = Feature::findByName($this->features, $featureName, $permissive);
        if (!$feature)
            throw new ModelException("the model has no feature named \"$featureName\"");
        return $feature;
    }
1082482
protected function getModelName($tableName)
    {
        $modelName = ResourceMapper::pluckFirst($tableName, 'table-name', 'model-name');

        return $modelName ?: $this->makeModelName($tableName);
    }
1136612
public function getModelDefinitionByFieldName($fieldName)
    {
        foreach ($this->fieldMappings as $mapping) {
            if (in_array($fieldName, $mapping->getFields())) {
                return $mapping;
            }
        }

        throw new \InvalidArgumentException(sprintf('%s does not exists in %s', $fieldName, $this->name));
    }
235076
protected function getModel()
    {
        $modelClass = trim($this->argument('model'));

        $modelInstance = new $modelClass;

        if (
            ! ($modelInstance instanceof Model) ||
            ! in_array(Searchable::class, class_uses_recursive($modelClass))
        ) {
            throw new InvalidArgumentException(sprintf(
                'The %s class must extend %s and use the %s trait.',
                $modelClass,
                Model::class,
                Searchable::class
            ));
        }

        return $modelInstance;
    }
1280384
public function reduce($modelName)
    {
        $file = self::getMapper();

        $finalMaps = [];

        if (File::Exists($file)) {

            $maps = self::getMaps($file);

            $existingMaps = Collect($maps)->filter(function ($map) use ($modelName) {
                return !$this->mapExists($map, $modelName);
            });

            foreach ($existingMaps as $existingMap) {
                $finalMaps[] = (object) $existingMap;
            }
        }

        File::put($file, Helpers::prettifyJson($finalMaps));
    }
150710
private function factory($name)
    {
        if ($this->factoryMuffin->isPendingOrSaved($this->model)) {
            return $this->factoryMuffin->create($name);
        }

        return $this->factoryMuffin->instance($name);
    }