Call a model class

@since   1.0
@param   string $modelName Model class name
@return  object|bool Return model defined in $modelName or false if error
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();
    }
605343
public function getMemberByUsername($username)
    {
        $timeStamp = time();
        $result = $this->em->getRepository($this->entity['m']['name'])->findOneBy(array('username' => $username));
        if (is_null($result)) {
            return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
        }
        return new ModelResponse($result, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
    }
31925
public function setControllerName($modelName)
    {
        $name = end(explode('/', $modelName));
        $this->_controllerName = ucfirst(Text::plural(lcfirst($name)));
        return $this;
    }
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());
    }
1039345
public function call($className, $method, $arguments = null)
    {
        $callable = [$className, $method];
        if ($arguments === null) {
            return call_user_func($callable);
        } else {
            return call_user_func_array($callable, $arguments);
        }
    }
381887
public static function getModel($modelName, $uniqueIdentifier = null)
    {
        $class = self::getModelClass($modelName);
        $model = new $class($uniqueIdentifier);

        return $model;
    }
105523
protected function getModelClass(string $argumentName = 'model'): string
    {
        $model = $this->directiveArgValue($argumentName);

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

        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);
    }
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));
    }
885611
protected function callModel($resource)
    {
        $modelName = $this->getModelName($resource);

        if ($this->confirm("Do you want me to create a $modelName model? [yes|no]"))
        {
            $this->call('generate:model', compact('modelName'));
        }
    }
276563
public static function makeFormRequestName($modelName)
    {
        $name = self::getProperCaseFor($modelName, 'request-form-name');
        $case = ucfirst(camel_case($name));

        if (!empty($postFix = Config::getFormRequestNamePostFix())) {
            return str_finish($case, $postFix);
        }

        return $case;
    }
1344093
public function getRelationships($modelName) {
		if ($this->models->has($modelName)
				&& $this->models->get($modelName)->has('relationships')) {
			return $this->models->get($modelName)->get('relationships');
		}
		return new Map();
	}
1121015
protected function modelClassName($strTableName)
    {
        $strTableName = $this->stripPrefixFromTable($strTableName);
        return sprintf('%s%s%s',
            $this->strClassPrefix,
            QString::camelCaseFromUnderscore($strTableName),
            $this->strClassSuffix);
    }
1049367
public function generator($className)
    {
        foreach ($this->generators as $generator) {
            if ($generator->supports($className)) {
                return $generator->createGenerator($className);
            }
        }

        return false;
    }
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();
	}
23536
protected function getRegisteredObject($sClassName)
    {
        // Get the corresponding callable object
        $xCallableObject = $this->getCallableObject($sClassName);
        return ($xCallableObject) ? $xCallableObject->getRegisteredObject() : null;
    }
324946
protected function getModel($model) {
		$args = func_get_args();
		array_shift($args);
		require 'app/models/' . $model . '.php';
       	$class = 'Tadpole\model\\' . $model;
		if(!empty($args)) {
			$modData = new ReflectionClass($class);
			$returnMod = $modData->newInstanceArgs($args);
			return $returnMod;
		} else {
        	$returnMod = new $class;
			return $returnMod;
		}
	}
190284
protected function generateSearchClassName($modelClassName)
    {
        $searchClassName = $this->searchModelClass;
        if (empty($searchClassName) || strpos($this->tableName, '*') !== false) {
            $searchClassName = $modelClassName;
        }
        return $searchClassName;
    }