Get the model class from the `model` argument of the field.

This works differently as in other directives, so we define a separate function for it.

@return string
@throws \Nuwave\Lighthouse\Exceptions\DirectiveException
546185
protected function getPaginatorModel(): string
    {
        $model = $this->directiveArgValue('model');

        // Fallback to using information from the schema definition as the model name
        if (! $model) {
            $model = ASTHelper::getUnderlyingTypeName($this->definitionNode);

            // Cut the added type suffix to get the base model class name
            $model = Str::before($model, 'Paginator');
            $model = Str::before($model, 'Connection');
        }

        if (! $model) {
            throw new DirectiveException(
                "A `model` argument must be assigned to the '{$this->name()}' directive on '{$this->definitionNode->name->value}"
            );
        }

        return $this->namespaceModelClass($model);
    }
1082732
public function getModel() {
        $model = new $this->_options['model']();
        foreach ($this->_options['bindings'] as $binding => $bindingOptions) {
            if (is_numeric($binding)) {
                $model->bindModel($bindingOptions);
            } elseif (is_string($binding)) {
                $model->bindModel($binding, $bindingOptions);
            }
        }
        return $model;
    }
427393
protected function getModel()
	{
		if (!$model = $this->owner) {
			throw new \Exception('Model is not been initialized properly.');
		}
		if (!$model instanceof ActiveRecord) {
			throw new \Exception(sprintf('Behavior must be applied to the ActiveRecord model class and it\'s iheritants, the unsupported class provided: `%s`', get_class($model)));
		}

		return $model;
	}
822780
public function getModelBaseClass()
    {
        // Use the non-plural version of the controller name if no model
        // is already specified.
        if (empty($this->modelBaseClass)) {
            $this->modelBaseClass = Str::singular(str_replace('Controller', '', class_basename($this)));
        }

        return $this->modelBaseClass;
    }
958094
public function getParentClass()
    {
        return ($reflection = parent::getParentClass()) ? new self($reflection->getName(), $this->mapper, $this->entityReflectionProvider) : null;
    }
698640
public function getClass()
    {
        return $this->refl->isAbstract()
            ? null
            : new ParsedClass(
                (string) $this->refl->getDocComment(),
                $this->getCleanReflectionName(),
                $this->refl->getNamespaceName(),
                $this->getMethods()
            );
    }
574197
public function getModelName()
    {
        if (is_null($this->_modelName)) {
            $this->setModelName('Models\\' .
                ucfirst($this->get('modelSingular'))
            );
        }
        return $this->_modelName;
    }
40825
protected function getOtherModelClass()
    {
        $this->otherModelClass = array_get($this->actionData->options(), 'model');

        if ( ! $this->otherModelClass) {
            throw new UnexpectedValueException("No target model class set in options");
        }

        if ( ! is_a($this->otherModelClass, Model::class, true)) {
            throw new UnexpectedValueException("{$this->otherModelClass} is not a valid target model class");
        }

        /** @var ModelInformationRepositoryInterface $infoRepository */
        $infoRepository = app(ModelInformationRepositoryInterface::class);

        $info = $infoRepository->getByModelClass($this->otherModelClass);

        if ( ! $info) {
            throw new UnexpectedValueException("{$this->otherModelClass} is not a CMS model");
        }

        return $this->otherModelClass;
    }
237126
public function getModel()
    {

        if ($this->modelClass == null) {
            (new LogMessage())->writeError('No modelClass defined');
            return;
        }


        $model = (new ModelFactory())->getModelByClassName($this->modelClass);
        return $model;

    }
771879
public function getReflectionClass()
    {
        if (!$this->refClass) {
            $this->refClass = new \ReflectionClass($this->getName());
        }

        return $this->refClass;
    }
373266
public function getModelClass()
    {
        if (isset($this->parent)) {
            return $this->parent->getModelClass();
        }

        if (isset($this->getCollection()->first)) {
            return $this->getCollection()->first->class;
        }

        return get_class($this->getCollection()->getModel());
    }
1152048
protected function getModelNamespace()
    {
        /** @var TableMap $tableMap */
        $tableMap = $this->getModelTableMap();
        return (null !== $tableMap) ? $tableMap::getOMClass(FALSE) : null;
    }
305414
protected function getExportModel()
    {
        $model = $this->getModel();
        $noExportColumns = $model->getColNames('noExport');
        foreach($noExportColumns as $colName) {
            $model->remove($colName, 'label');
        }
        return $model;
    }
1356981
public static function GetName () {
		$class_name = static::class;
		if (!isset(static::$_nameList[$class_name])) {
			if (defined($class_name.'::NAME')) {
				$name = $class_name::NAME;
			} else {
				preg_match("/^(.+)Model$/", str_replace("\\", '/', $class_name), $matches);
				$name = basename($matches[1]);
				if (static::$_useSnakeCase) {
					$name = Strings::ToSnakeCase($name);
				}
			}
			static::$_nameList[$class_name] = $name;
		}
		return static::$_nameList[$class_name];
	}
801192
public function getClass(): string
    {
        foreach ($this->resourceRecords as $resourceRecord) {
            if (null !== $resourceRecord->getClass()) {
                return $resourceRecord->getClass();
            }
        }

        return Classes::INTERNET;
    }
496369
public function getSeverityClass()
    {
        switch ($this->getSeverity()) {
            case self::SEVERITY_CRITICAL:
                return 'danger';

            case self::SEVERITY_HIGH:
                return 'warning';

            case self::SEVERITY_NORMAL:
                return 'info';

            case self::SEVERITY_LOW:
                return 'default';
        }
    }
1057993
protected function getTableModel() {
		if ($this->_model === null) {
			$this->_model = $this->createTableModel();
		}
		
		return $this->_model;
	}