@param string|array $aliases

@return $this
514740
public function addAlias($aliases)
    {
        if (! is_array($aliases)) {
            $aliases = func_get_args();
        }

        foreach ($aliases as $alias) {
            $this->aliases[] = $alias;
        }

        return $this;
    }
74847
public function addAliases(array $aliases)
    {
        foreach ($aliases as $alias => $id) {
            $this->setAlias($alias, $id);
        }
    }
281914
public static function setAliases(array $aliases)
    {
        foreach ($aliases as $name => $path) {
            self::setAlias($name, $path);
        }
    }
328055
protected function storeCustomAliases(array $aliases)
    {
        $pathCount = 0;

        foreach ($aliases as $alias) {
            $paths = $this->combinePaths($alias->pathData);
            $pathCount += count($paths);

            foreach ($paths as $path) {
                $this->storeCustomAliasPath(
                    $alias->destination,
                    $path,
                    reset($alias->languageCodes),
                    $alias->alwaysAvailable,
                    $alias->forward
                );
            }
        }

        return $pathCount;
    }
458676
public function addFilters(array $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof QueryDSL) {
                $this->addFilter($filter);
            }
        }
        return $this;
    }
88625
public function filterByIds($ids)
    {
        $this->getInstance()->andWhere($this->mainAlias.'.id IN (:ids)')->setParameter('ids', $ids);

        return $this;
    }
270762
public static function fromAliasesMap(array $aliases)
    {
        $detectedCycles = array_filter(array_map(
            function ($alias) use ($aliases) {
                return self::getCycleFor($aliases, $alias);
            },
            array_keys($aliases)
        ));

        if (! $detectedCycles) {
            return new self(sprintf(
                "A cycle was detected within the following aliases map:\n\n%s",
                self::printReferencesMap($aliases)
            ));
        }

        return new self(sprintf(
            "Cycles were detected within the provided aliases:\n\n%s\n\n"
            . "The cycle was detected in the following alias map:\n\n%s",
            self::printCycles(self::deDuplicateDetectedCycles($detectedCycles)),
            self::printReferencesMap($aliases)
        ));
    }
1178537
public function remove($alias)
    {
        $id = $this->getId($alias);
        if ($id) {
            unset($this->aliases[$alias]);
            $aliases = &$this->ids[$id];
            unset($aliases[array_search($alias, $aliases, true)]);
            if (!empty($aliases)) {
                $this->removeDependedAliases($alias, $id);
            } else {
                unset($this->ids[$id]);
            }
        }

        return $this;
    }
211152
public function registerAlias($alias, $className)
    {

        $this->_aliases[$alias] = $this->resolveClassName($className);

        return $this;
    }
924161
public final function alias($alias) {
        $this->alias         = $alias;
        $this->qualifiedName = $this->table . ' AS ' . $this->alias;

        return $this;
    }
360543
public function setFilters($filters = [])
    {
        foreach ($filters as $key => $value) {
            $this->addFilter($key, $value);
        }

        return $this;
    }
474893
public function setFrom($table, $alias = null)
    {
        $this->table = $table;
        $this->aliasTable = $alias === null ? $table : $alias;

        return $this;
    }
1288439
public function withFacades($aliases = true, $custom = [])
    {
        Facade::setFacadeApplication($this);

        if ($aliases) {
            $this->withAliases($custom);
        }

        return $this;
    }
562734
public function setAlias($alias)
    {
        /**
         * @T00D00
         */
        $this->alias = $alias;
        $this->getQuery()->alias($alias);

        return $this;
    }
667053
public function from($table, $alias = null) {
        $this->_table = (string) $table;
        $this->asAlias($alias);

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

        return $this;
    }
912320
public function setAlias($aliases, $option)
	{
		$aliases = (array) $aliases;

		foreach ($aliases as $alias)
		{
			$this->aliases[$alias] = $option;
		}

		return $this;
	}