Creates a new QueryBuilder instance that is prepopulated for this entity name.

@param string $alias
@param string $indexBy The index for the from.

@return QueryBuilder
555942
public function createQueryBuilder($alias, $indexBy = null)
    {
        $qb = $this->repository->createQueryBuilder($alias, $indexBy);

        $this->applySecurityModel($qb, $alias);

        return $qb;
    }
763955
public function handle(Client $client, $index, $alias)
    {
        $settings = $this->configurations->getSettings($alias);

        if (null === $settings) {
            throw new \InvalidArgumentException();
        }

        $client->getIndex($index)->setSettings($settings);
    }
331595
public function innerJoin($join, $alias)
    {
        if (!in_array($alias, $this->joins)) {
            $this->queryBuilder->innerJoin($join, $alias);
            array_push($this->joins, $alias);
        }

        return $this;
    }
517775
public function innerJoin($mixed, $criteria, $alias='')
    {
        if(is_string($mixed) && strpos($mixed, " ") !== false) {
            throw new \InvalidArgumentException(
                "Invalid table name '$mixed'. Possibly use alias parameter instead?");
        }

        return $this->_join('INNER JOIN', $mixed, $criteria, $alias);
    }
1014953
private function hasJoin(ProxyQueryInterface $queryBuilder, $alias)
    {
        $joins = $queryBuilder->getDQLPart('join');

        if (!isset($joins[$alias])) {
            return false;
        }

        foreach ($joins[$alias] as $join) {
            if ('trans' === $join->getAlias()) {
                return true;
            }
        }

        return false;
    }
1366895
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof UserCustomerRelationQuery) {
            return $criteria;
        }
        $query = new UserCustomerRelationQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
86828
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof \Dealer\Model\DealerAdminQuery) {
            return $criteria;
        }
        $query = new \Dealer\Model\DealerAdminQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
879641
public function subQuery(QueryBuilderHandler $queryBuilder, $alias = null)
    {
        $sql = '(' . $queryBuilder->getQuery()->getRawSql() . ')';
        if ($alias) {
            $sql = $sql . ' as ' . $alias;
        }

        return $queryBuilder->raw($sql);
    }
1299821
public function column($name, string $alias = null): self
    {
        $this->sql->addColumn($name, $alias);
        return $this;
    }
472852
public function indexBy($indexBy)
    {
        if (is_array($indexBy)) {
            $this->select([key($indexBy), current($indexBy)]);
        }

        $this->_index = $indexBy;

        return $this;
    }
445919
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof \CustomerGroup\Model\CustomerCustomerGroupQuery) {
            return $criteria;
        }
        $query = new \CustomerGroup\Model\CustomerCustomerGroupQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
40052
public function withAlias($aliasAction, $alias)
    {
        $this->aliasAction = $aliasAction;
        $this->alias = $alias;
        return $this;
    }
1191299
public function From(string $table, string $alias = ''): QueryBuilder
    {
        $this->table = $table;
        
        if (! empty($alias)) {
            $this->alias = $alias;
        }
        
        return $this;
    }
410336
public function createAlias($alias)
    {
        class_alias('Pixie\\AliasFacade', $alias);
        $builder = $this->container->build('\\Pixie\\QueryBuilder\\QueryBuilderHandler', array($this));
        AliasFacade::setQueryBuilderInstance($builder);
    }
1334878
public function toQuery( Query $query, array $columns = [], $alias = '' ) {

		foreach( $this->criteria as $column => $criteria ) {

			if( !$column = $this->getColumnName($columns, $column, $alias) )
				continue;

			foreach( $criteria as $operator => $value ) {
				$query->where($column, $operator, $value);
			}

		}

		foreach( $this->getOrder() as $column => $ascending ) {
			$column = $this->getColumnName($columns, $column, $alias);
			if( !$column )
				continue;
			$query->orderBy($column, $ascending);
		}

		if( $this->offset )
			$query->offset($this->offset);

		if( $this->limit )
			$query->limit($this->limit);

		return $query;

	}
1069281
public final function join($tableName, $targetTableName = null, $alias = null)
    {
        return new QueryHelper\QueryJoin($this, $tableName, 'JOIN', $targetTableName, $alias);
    }
1082361
public function createResultSetMappingBuilder($alias)
    {
        $rsm = new ResultSetMappingBuilder($this->em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);
        $rsm->addRootEntityFromClassMetadata($this->entityName, $alias);

        return $rsm;
    }