alias

@param string $target
@param string $alias
@param array  $options
@param array  $attrs

@return  static
511052
public function alias($target, $alias, array $options = [], array $attrs = [])
    {
        $this->normalizeUri($target, $name);

        $this->aliases[$name] = [
            'alias' => $alias,
            'options' => $options,
            'attrs' => $attrs
        ];

        return $this;
    }
1314391
public function setAlias($alias) {
        if ($alias !== null && ! $this->argumentsParser->isOptionAlias($alias)) {
            throw new InvalidOptionAliasException(s(
                'A option alias must have this format: "-f", got: "%s"', $alias
            ));
        }

        $this->alias = $alias;

        return $this;
    }
465369
private function makeExpressions($conditions, $alias = self::DEFAULT_TABLE_ALIAS)
    {
        $expressions = [];
        foreach ($conditions as $attr) {
            $field = $attr['field'];
            if (strpos($field, '.') > 0) {
                //monta os joins
                $newAliasField = $this->associationQueryFields($field);
                $alias = $newAliasField['alias'];
                $field = $newAliasField['field'];
            }
            $expressions[] = $this->makeExpression($field, $attr['operation'], $attr['value'], $alias);
        }

        return $expressions;
    }
303984
protected function getNewSiteRemoteAlias($site_name, $options) {
    if (empty($options['remote-alias'])) {
      $default = $site_name . '.local';
      $alias = $this->askDefault("Default remote drush alias", $default);
    }
    else {
      $alias = $options['remote-alias'];
    }
    return $alias;
  }
168039
public function addAlias($index, $alias, $aliasParameters = [])
    {
        return (bool)$this->db->put([$index, '_alias', $alias], [], json_encode((object)$aliasParameters));
    }
994147
public function setAliasOf($alias) {
        $alias = $this->normalizeID($alias);

        if ($alias === $this->currentRuleName) {
            trigger_error("You cannot set alias '$alias' to itself.", E_USER_NOTICE);
        } else {
            $this->currentRule['aliasOf'] = $alias;
        }
        return $this;
    }
1244148
public function alias($alias = null)
    {
        if ($alias !== null) {
            $this->setAlias($alias);
        }

        return $this->getAlias();
    }
611407
public function mergeNameAndAlias(array $args, $name, $alias) {
        if ( ! $name && ! $alias) {
            return $args;
        }

        $namedValues = array_take($args, $name);
        $aliasedValues = array_take($args, $alias);

        if ($namedValues === null && $aliasedValues === null) {
            return $args;
        }

        if ( ! is_array($namedValues)) {
            $namedValues = [];
        }

        if ( ! is_array($aliasedValues)) {
            $aliasedValues = [];
        }

        $mergedValues = array_merge($namedValues, $aliasedValues);

        if ($name) {
            array_set($args, $name, $mergedValues);
        } else {
            array_set($args, $alias, $mergedValues);
        }

        return $this->mergeNameAndAliasCount($args, $name, $alias);
    }
1088254
public static function define($name, $attrs, $options = null)
    {
        self::$_factories[$name] = $attrs;
        self::$_options[$name]   = $options;
    }
1027585
public static function getInstance( array $aliases = [] )
	{
		if( is_null( static::$instance )) {
			return static::$instance = new static( $aliases );
		}

		$aliases = array_merge( static::$instance->aliases, $aliases );

		static::$instance->aliases = $aliases;

		return static::$instance;
	}
309550
function getAlias( $alias ) {

        return isset( $this->aliases[ $alias ] ) ? $this->aliases[ $alias ] : $alias;

    }
608560
private function preload($target, $alias)
    {
        if (!is_file($target) || !is_readable($target)) {
            throw new RuntimeException('Either invalid file supplied or its not readable');
        }

        // Prepare base name
        if ($alias === null) {
            $baseName = FileManager::getBaseName($target);
        } else {
            $baseName = $alias;
        }

        // Grab the Mime-Type
        $mime = FileManager::getMimeType($target);

        $this->prepare($mime, $baseName);
    }
581025
public function addScript($url, $options = [], $attribs = [])
    {
        // B/C
        if (!is_array($options)) {
            $options = ['version' => $options];
        }

        $options = array_merge([
            'version' => null,
        ], $options);

        $alias = $this->resolveRawAlias($url);

        $file = [
            'url' => $this->handleUri($url),
            'attribs' => array_merge($attribs, $alias['attrs'] ?? []),
            'options' => array_merge($options, $alias['options'] ?? []),
        ];

        $this->scripts[$url] = $file;

        return $this;
    }
792398
public static function newRelation($alias = null, $table = null, $keys = null, $db = null)
    {
        $instance = new static($table, $keys, $db);

        return $instance->alias($alias);
    }
543294
public static function create($option = array(), $alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		if(isset(self::$instances[static::$driverName][$alias]))
		{
			return self::$instances[static::$driverName][$alias];
		}
		else
		{
			$object = static::__createBefore($option, $alias);
			if(null === $object)
			{
				$className = static::$driverName . $option['type'];
				$ref = new ReflectionClass($className);
				$object = $ref->newInstance(isset($option['option']) ? $option['option'] : array());
			}
			static::__createAfter($option, $alias, $object);
			if(null !== $alias)
			{
				self::$instances[static::$driverName][$alias] = $object;
			}
			return $object;
		}
	}
915748
public function register($alias, $source = null, $dependencies = [], $options = [])
    {
        $asset = $this->_factory->create($alias, $source, $dependencies, $options);
        $this->_collection->add($asset);

        return $this;
    }
1252775
public function aliasAuthor($alias, $realAuthor)
    {
        $this->mapping[$this->arrayKey($alias)] = trim($realAuthor);

        return $this;
    }