@param $alias

@return Expr\Subquery|null
554445
public function getSubqueryByAlias($alias)
    {
        return $this->hasSubqueryAlias($alias) ? $this->getExpression($this->getHash($alias)) : null;
    }
211182
protected function createQueryBuilder($alias = 'a')
    {
        $repository = $this->get('orm.em')->getRepository($this->getEntityClass());

        $queryBuilder = $repository->createQueryBuilder($alias);

        return $queryBuilder;
    }
1162803
public function lcase($column, string $alias = null): self
    {
        return $this->column((new Expression())->lcase($column), $alias);
    }
1281430
private function getRelatedBuilder($alias) {
        foreach($this->getRelatedBuilders() as $key => $builder) {
            if($alias == $key) {
                return $builder;
            }
        }
        return null;
    }
923571
public function getAuthorize($alias)
    {
        if (empty($this->_authorizeObjects)) {
            $this->constructAuthorize();
        }

        return isset($this->_authorizeObjects[$alias]) ? $this->_authorizeObjects[$alias] : null;
    }
177248
public function getDomain($alias) {
		if (isset($this->aliases[$alias])) {
			return $this->aliases[$alias];
		}
		return $alias;
	}
195459
public function createQueryBuilder($alias = null)
    {
        if ($alias === null) {
            $alias = $this->getAlias();
        }

        if (empty($alias)) {
            $select = '*';
        } else {
            $select = $alias . '.*';
        }

        return $this->em->createQueryBuilder()
            ->select($select)
            ->from($this->getTableName(), $alias);
    }
941734
public function getChildByAlias($alias)
    {
		$f = self::getDbConnection()->fetchAssoc("select A.* from dir_data A, dir_structure B, dir_structure C where C.data_id=? and B.data_id=A.id and B.level=C.level+1 and B.lft BETWEEN C.lft and C.rght and A.tablename=?", array($this->id, $alias));
        if (!$f) throw new Exception\CMS(Exception\CMS::CAT_NOT_FOUND);
        $f['parent'] = $this;
        $cat = Catalog::fetch($f);
        return $cat;
    }
998977
public function alias($alias = null)
    {
        if ($alias !== null) {
            $this->alias = $alias;
        }

        return $this->alias;
    }
238008
public function alias(string $alias): AliasInterface
    {
        if (!in_array($alias, $this->alias)) {
            $this->alias[] = $alias;
        }
        $this->aliasHelper($alias);

        return $this;
    }
236320
public function findByAlias(string $alias): ?Tag
    {
        /** @var TagModel $adapter */
        $adapter = $this->framework->getAdapter(TagModel::class);

        $criteria = $this->getCriteria();
        $criteria['alias'] = $alias;

        if (null === ($model = $adapter->findOneByCriteria($criteria))) {
            return null;
        }

        return ModelCollection::createTagFromModel($model);
    }
51637
public function query($table = null, $alias = null)
    {
        return $this->_di->get('ManaPHP\Db\Query', [$this])->from($table, $alias);
    }
727676
public function alias($alias = null)
    {
        if ($alias === null) {
            return $this->_alias;
        }
        $this->_alias = $alias;

        return $this;
    }
1165167
public function selectColumn(string $column, ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->column($column, $alias);

        return $instance;
    }
918254
public function createResultSetMappingBuilder($alias)
    {
        $rsm = new ResultSetMappingBuilder($this->_em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);
        $rsm->addRootEntityFromClassMetadata($this->_entityName, $alias);

        return $rsm;
    }
964143
public function hasColumnAlias($alias)
    {
        return $this->hasAlias($alias) && $this->getExpression($this->getHash($alias)) instanceof Expr\Column;
    }
299824
public function subQuery( $table, $alias=null )
    {
        $sub = new self();
        if( !$alias ) $alias = 'sub_' . $this->subQueryCount ++;
        $sub->table( $table, $alias );
        $sub->setParentTable( $this->getAliasOrTable() );
        return $sub;
    }