Returns a token model of the specified class with full display information

@param string $modelClass Optional class to use instead of StandardTokenModel. Must be subclass.
@return \Gems_Tracker_Model_StandardTokenModel
329206
public function getTokenModel($modelClass = 'StandardTokenModel')
    {
        if (! isset($this->_tokenModels[$modelClass])) {
            $this->_tokenModels[$modelClass] = $this->_loadClass('Model_' . $modelClass, true);
            $this->_tokenModels[$modelClass]->applyFormatting();
        }

        return $this->_tokenModels[$modelClass];
    }
946776
protected function _getClassIndices($class)
    {
        $indices = array ();
        if ($class == self::CLASS_LETTER) {
            $indices = array_merge(
                $this->_getClassIndices(self::CLASS_LOWER),
                $this->_getClassIndices(self::CLASS_UPPER)
            );
            sort($indices);
        } else {
            if (isset ($this->_tokenIndices[$class])) {
                $indices = $this->_tokenIndices[$class];
            }
        }

        return $indices;
    }
1342459
private function getRepositoryByClass(string $modelClass): RepositoryInterface
    {
        foreach ($this->repositoryKeys as $repositoryKey) {
            /** @var RepositoryInterface $repository */
            $repository = $this->container->get($repositoryKey);
            if ($repository->isResponsible($modelClass)) {
                return $repository;
            }
        }

        throw MissingRepositoryException::create($modelClass);
    }
1358616
protected function namespaceModelClass(string $modelClassCandidate): string
    {
        return $this->namespaceClassName(
            $modelClassCandidate,
            (array) config('lighthouse.namespaces.models'),
            function (string $classCandidate): bool {
                return is_subclass_of($classCandidate, Model::class);
            }
        );
    }
723180
protected function createTable(string $modelClass, array $expressions = []): Table
    {
        $context = new MigrationContext($modelClass, $this->getModelSchemas());
        assert(
            $this->getModelSchemas()->hasClass($modelClass),
            "Class `$modelClass` is not found in model Schemas."
        );
        $tableName = $this->getModelSchemas()->getTable($modelClass);
        $table     = new Table($tableName);
        foreach ($expressions as $expression) {
            /** @var Closure $expression */
            $expression($table, $context);
        }

        $this->getSchemaManager()->dropAndCreateTable($table);

        return $table;
    }
1020445
protected function getModelColumns($class)
    {
        $attributes = [];

        $classNamespace = $this->getModelNamespace($class);

        if ($class) {
            if (class_exists($classNamespace)) {
                $model = new \ReflectionClass($classNamespace);

                if ($model->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
                    $mdl = $this->app->make($classNamespace);
                    $table = $mdl->getTable();

                    if (is_array($table)) {
                        $table = array_first($table);
                    }

                    $table = $mdl->getConnection()->getTablePrefix().$table;
                    $schema = $mdl->getConnection()->getDoctrineSchemaManager($table);

                    $database = null;
                    if (strpos($table, '.')) {
                        list($database, $table) = explode('.', $table);
                    }

                    $columns = Arr::except($schema->listTableColumns($table, $database), $mdl->getHidden());

                    foreach ($columns as $column) {
                        if ($column->getType() instanceof \Doctrine\DBAL\Types\JsonArrayType) {
                            continue;
                        }

                        $castTo = $this->getCasting($column->getType());

                        $attributes[] = ['column' => $column->getName(), 'casts' => $castTo];
                    }

                    return $attributes;
                }
            } else {
                $this->error("Your model {$class} was not found in {$this->config->get('fractal.model_namespace')}\\ \r\nIf this is the first time you get this message, try to update /config/fractal.php to make changes to model_namespace accordingly.");
                exit();
            }
        }

        // use as a default attribute
        return [
            ['column' => 'id', 'casts' => null],
        ];
    }
753142
protected function getModelClass(): string
    {
        $class = substr(get_class($this), strrpos(get_class($this), '\\') + 1);
        $class = substr($class, 0, strlen($class) - strlen('Repository'));

        return 'Infakt\\Model\\'.$class;
    }
792250
public function setModel($modelClass) {
		$reflection = new ReflectionClass($modelClass);
		if (! $reflection->implementsInterface('ZExt\Model\ModelInterface')) {
			throw new Exception('Class of a model must implements "ModelInterface"');
		}
		
		$this->_modelClass = $modelClass;
		
		if (! empty($this->_models)) {
			$currentModels = $this->_models;
			$this->_models = [];

			foreach ($currentModels as $key => $model) {
				if ($model instanceof $modelClass) {
					$this->_models[$key] = $model;
				} else {
					$model->uninitialize();
				}
			}
		}
				
		return $this;
	}
497103
private function getModel($class)
    {
        $reflectionClass = new \ReflectionClass($class);
        $instance = $reflectionClass->newInstance();
        if (!($instance instanceof ModelInterface)) {
            throw new \Exception('This class is not supported');
        }

        return $instance;
    }
599490
private function getCustomObjectMeta($entityClass)
    {
        if (!array_key_exists($entityClass, $this->customObjectMeta)) {
            $meta = $this->extendedMetadataFactory->getExtendedMetadata($entityClass);

            $this->customObjectMeta[$entityClass] = isset($meta['customObjects']) && !empty($meta['customObjects'])
                ? $meta['customObjects']
                : null;
        }

        return $this->customObjectMeta[$entityClass];
    }
516912
private function fetchResourceWithoutRelationships(QueryBuilder $builder, string $modelClass)
    {
        $model     = null;
        $statement = $builder->execute();

        if ($this->isFetchTyped() === true) {
            $statement->setFetchMode(PDOConnection::FETCH_ASSOC);
            if (($attributes = $statement->fetch()) !== false) {
                $platform  = $builder->getConnection()->getDatabasePlatform();
                $typeNames = $this->getModelSchemas()->getAttributeTypes($modelClass);
                $model     = $this->readResourceFromAssoc($modelClass, $attributes, $typeNames, $platform);
            }
        } else {
            $statement->setFetchMode(PDOConnection::FETCH_CLASS, $modelClass);
            if (($fetched = $statement->fetch()) !== false) {
                $model = $fetched;
            }
        }

        return $model;
    }
187747
public function setModelClass($class)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($class) {
            if ($tab instanceof DisplayInterface) {
                $tab->setModelClass($class);
            }
        });

        return $this;
    }
362688
private function getClass($objectOrClass)
    {
        $class = is_object($objectOrClass) ? ClassUtils::getClass($objectOrClass) : $objectOrClass;

        return isset($this->entityOverride[$class]) ? $this->entityOverride[$class] : $class;
    }
735748
protected function createModel()
    {
        $model = $this->token->getModel();

        if ($model instanceof \Gems_Tracker_Model_StandardTokenModel) {
            $model->addEditTracking();

            if ($this->createData) {
                $model->applyInsertionFormatting();
            }
        }

        return $model;
    }
237126
public function getModel()
    {

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


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

    }
1101426
public function GetPrimaryKeyMap($objectclass)
	{
		$fms = $this->GetFieldMaps($objectclass);
		foreach ($fms as $fm)
		{
			if ($fm->IsPrimaryKey)
			{
				return $fm;
			}
		}
	}
1291130
public function type($class)
    {
        // Remove leading backslash. All namespaces are assumed absolute in YAML
        $class = ltrim($class, '\\');

        foreach ($this->types as $scaffold) {
            if ($scaffold->getDataObjectClass() === $class) {
                return $scaffold;
            }
        }

        $scaffold = Injector::inst()->create(DataObjectScaffolder::class, $class)
                ->setChainableParent($this);
        $this->types[] = $scaffold;

        return $scaffold;
    }