Set alias, and return AliasManipulator.

@param array|string|null $alias

@return AliasManipulator
353312
public function setAlias($alias)
    {
        $aliasManipulator = new AliasManipulator($this->originalDir, $this->alias);
        $aliasManipulator->setAlias($alias);

        return $aliasManipulator;
    }
499753
public function getAuthenticate($alias)
    {
        if (empty($this->_authenticateObjects)) {
            $this->constructAuthenticate();
        }

        return isset($this->_authenticateObjects[$alias]) ? $this->_authenticateObjects[$alias] : null;
    }
155048
public function alias($alias = null)
    {
        if (null === $alias) {
            $alias = $this->getTableAlias();
        }
        $this->oosql_table_alias = $alias;
        return $this;
    }
755537
public function setAlias($alias)
    {
        if (!is_string($alias)) {
            throw new Exception(Exception::CODE_PARAM_VALUE_ERROR_MSG . ' Alias Must A String', Exception::CODE_PARAM_VALUE_ERROR);
        }
        $lastPattern = array_pop($this->_patterns);
        if ($lastPattern) {
            $lastPattern[5] = $alias;
            $this->_patterns[] = $lastPattern;
        }
        return $this;
    }
1165728
public static function alias($name, $alias = null)
    {
        // get real name for $id
        if (null === $alias) {
            return self::resolveAlias($name);
        }

        foreach ((array)$alias as $aliasName) {
            if (!isset(self::$aliases[$aliasName])) {
                self::$aliases[$aliasName] = $name;
            }
        }

        return true;
    }
520593
public function alias($abstract, $alias)
    {
        $this->aliases[$alias] = $abstract;
//        $this->abstractAliases[$abstract][] = $alias;

        $this->share($alias, function () use ($abstract) {
            return $this->get($abstract);
        });
    }
776065
public function alias($alias)
    {
        $alias = (string)$alias;
        if (in_array($alias, $this->with)) {
            throw new \InvalidArgumentException("Cannot use alias '{$alias}' because a relation already uses it");
        }

        $this->alias = $alias;

        return $this;
    }
534332
protected function resolveAlias($alias)
	{
		if (!empty($this->aliases[$alias]))
		{
			return $this->aliases[$alias];
		}

		return $alias;
	}
1244140
public function load(string $alias): ?bool
    {
        if (\strpos($alias, self::FACADE_NAMESPACE) === 0) {
            return $this->loadFacade($alias);
        }

        if (isset($this->aliases[$alias])) {
            return \class_alias($this->aliases[$alias], $alias);
        }

        return null;
    }
1359098
public function setAlias($name, $alias)
    {
        if ($alias === null && isset($this->aliases[$name])) {
            unset($this->aliases[$name]);
        } else {
            $this->aliases[$name] = $alias;
        }

        return $this;
    }
1102281
public function setAlias($alias) {
    if (is_string($alias)) {
      $alias = new TokenNode(T_STRING, $alias);
    }

    if ($alias instanceof TokenNode) {
      if ($this->hasAlias()) {
        $this->alias->replaceWith($alias);
      }
      else {
        $this->alias = $alias;
        $this->addChild(WhitespaceNode::create(' '));
        $this->addChild(Token::_as());
        $this->addChild(WhitespaceNode::create(' '));
        $this->addChild($alias, 'alias');
      }
    }
    elseif ($alias === NULL && $this->hasAlias()) {
      $this->alias->previousUntil(Filter::isInstanceOf('\Pharborist\Namespaces\NameNode'))->remove();
      $this->alias->remove();
      $this->alias = NULL;
    }
    else {
      throw new \InvalidArgumentException();
    }

    return $this;
  }
982903
public function setAlias(string $name, $alias): void
    {
        foreach ((array)$alias as $aliasName) {
            if (!isset($this->aliases[$aliasName])) {
                $this->aliases[$aliasName] = $name;
            }
        }
    }
1007300
public function getTableForAlias($alias)
    {
        if (isset($this->aliases[$alias])) {
            return $this->aliases[$alias];
        }

        return null;
    }
1098343
public function load($alias)
    {
        if (isset($this->aliases[$alias])) {
            return class_alias($this->aliases[$alias], $alias);
        }
        return null;
    }
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);
    }
584209
public function getAlias($alias)
    {
        return isset($this->_aliases[$alias]) ? $this->_aliases[$alias] : $alias;
    }
310898
public function alias($identifier, $alias)
    {
        $alias      = trim((string) $alias);
        $identifier = (string) $identifier;

        //Don't register the alias if it's the same as the identifier
        if($alias != $identifier) {
            $this->_aliases[$alias] = (string) $identifier;
        }

        return $this;
    }