Get data model by alias defined in module config.
@see getDataModel()
@param string $alias
@param array $params constructor parameters
@param array $config
@see getDataModel()
172544
public static function model($alias, $params = [], $config = [])
    {
        //$module = static::getInstance(); // built-in - get only from loaded modules
        $module = static::instance();
        if (!empty($module)) {
            return $module->getDataModel($alias, $params, $config);
        }
    }
259013
public function getWidget($alias, array $params = [])
    {
        if (empty($this->_widgets[$alias])) {
            throw new Exception("Shared widget '{$alias}' not found in configuration of module " . static::className());
        }
        $widget = Yii::createObject($this->_widgets[$alias], $params);
        return $widget;
    }
489023
public function selectConcat(array $columns, string $delimiter = '', ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->columnConcat($columns, $delimiter, $alias);

        return $instance;
    }
77247
public function alias($alias, DescriptorInterface $prototype, $params = null, $actions = null)
    {
        $descriptor = clone $prototype;

        $descriptor->setParams($params)->setActions($actions)->setName($alias);

        $key                     = $this->makeKey($alias);
        $this->descriptors[$key] = $descriptor;

        return $descriptor;
    }
71657
public function remove($alias, $config = array())
	{
		$tableName = $this->cache->parseField($this->tableName);
		$key = $this->cache->parseField('key');
		return $this->cache->execute(<<<SQL
delete from {$tableName} where {$key} = %s
SQL
,array($alias));
	}
125915
def get_by_alias(self, alias):
        
        if alias not in self._aliases:
            raise DataInvalidAlias('A dataset with alias {} does not exist'.format(alias))

        return self.get_by_index(self._aliases[alias])
38008
protected function
	GetConnectionConfig($Alias) {
	/*//
	@return Nether\Database\Connection
	fetch the specified configuration. if none is found then it will throw an
	exception instead.
	//*/

		$Config = Nether\Option::Get('nether-database-connections');

		if(!array_key_exists($Alias,$Config))
		throw new Nether\Database\Error\InvalidConfig($Alias);

		if($Config[$Alias] instanceof Nether\Database\Connection)
		return $Config[$Alias];

		return new Nether\Database\Connection($Config[$Alias]);
	}
59391
public function createByParams( $params = [], $config = [] ) {

		$model = $this->getModelObject();

		// Required
		$model->orderId = $params[ 'orderId' ];

		// Config
		$config[ 'transaction' ] = $model;

		// Return Transaction
		return parent::createByParams( $params, $config );
	}
1077456
public static function query($alias = null, $model = null)
    {
        if (!$model) {
            $model = Di::getDefault()->getShared(static::class);
        }

        $query = $model->_di->get('ManaPHP\Db\Query')->setModel($model);
        if ($alias) {
            $query->from(get_class($model), $alias);
        }

        return $query;
    }
1364743
public function translate($alias, array $params = [])
    {
        $result = '';
        $query  = $this->getQueryBuilder()
            ->select([$this->getResultFieldName()])
            ->where([
                $this->getLanguageFieldName() => $this->getLanguage(),
                $this->getAliasFieldName() => $alias
            ])
            ->table($this->getTableName())
            ->generate();
        $res    = $this->getConnection()->query($query,
            $this->getQueryBuilder()->getParams());

        if ($res !== false) {
            $result = $res->fetchColumn($this->getResultFieldName());
        }
        return $result;
    }
1017747
public function get($params = null) {
		$this->buffer = $this->getConfigs();

		if (isset($params)) {
			$params = trim($params);
			$params_list = explode('/', $params);
			$params_count = count($params_list);

			for ($i=0; $i<$params_count; $i++) {
				if ($i == $params_count) { return $this->buffer[$params_list[$i]]; }

				$this->buffer = $this->buffer[$params_list[$i]];
			}
		}

		return $this->buffer;
	}
403182
public function connect(\stdClass $params): QueryBuilderInterface
	{
		list($dsn, $dbtype, $params, $options) = $this->parseParams($params);

		$dbtype = ucfirst($dbtype);
		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

		// Create the database connection
		$db =  ! empty($params->user)
			? new $driver($dsn, $params->user, $params->pass, $options)
			: new $driver($dsn, '', '', $options);

		// Set the table prefix, if it exists
		if (isset($params->prefix))
		{
			$db->setTablePrefix($params->prefix);
		}

		// Create Query Builder object
		$conn = new QueryBuilder($db, new QueryParser($db));


		// Save it for later
		if (isset($params->alias))
		{
			$this->connections[$params->alias] = $conn;
		}
		else
		{
			$this->connections[] = $conn;
		}

		return $conn;
	}
324184
public function make($key, $params = [])
    {
        if($this->aliasExist($key)) {
            return $this->make($this->aliases[$key], $params);
        }

        if(is_callable($key)) {
            return call_user_func_array($key, $this->resolveCallback($key, $params));
        }

        return $this->resolveClass($key, $params);
    }
1262491
protected function share($binding, $class, $params = [], $alias = false)
    {
        if (is_string($class)) {
            $closure = function ($app) use ($class, $params) {
                return $app->build($class, $params);
            };
        } else {
            $closure = $class;
        }
        $this->app[ $binding ] = $this->app->share($closure);
        if ($alias) {
            $this->app->alias($binding, $class);
        }
    }
1018513
public function getParametersForAlias($alias)
    {
        foreach ($this->classMap as $item => $parameters) {
            if ($parameters['alias'] == $alias) {
                $parameters['class'] = $item;

                return $parameters;
            }
        }

        return null;
    }
573809
protected function CreateFunctionCount(array $params, $alias = '', $distinctParams = false)
    {
        return FunctionCall::Count($this->connection, $params, $alias, $distinctParams);
    }
1084094
private function addColumn($sql, $alias = null, array $params = [])
    {
        $this->columns[] = [
            'sql'    => $sql,
            'alias'  => $alias,
            'params' => $params,
        ];

        return $this;
    }