@param string $alias
@param string $value

@throws \Exception
963877
public static function setAlias(string $alias, string $value)
    {
        self::getInstance()->setAlias($alias, $value);
    }
1361600
protected function aliasAction($alias)
    {
        $request = $this->getRequest();
        $request->setActionName($alias);
        $request->setParam($request->getActionKey(), $alias);
    }
1251428
public function alias(string $alias, string $abstract): void
    {
        if (\array_key_exists($alias, $this->values) || isset($this->factory[$alias])) {
            throw new InvalidArgumentException("Already defined in container: $alias");
        }

        if ($alias === $abstract) {
            throw new InvalidArgumentException('Alias cannot be the same as the original name');
        }

        $this->alias[$alias] = $abstract;

        if (!isset($this->abstractAlias[$abstract])) {
            $this->abstractAlias[$abstract] = [];
        }

        $this->abstractAlias[$abstract][] = $alias;
    }
432860
protected function id2alias($value)
    {
        $event = $this->eventRepository->findByID($value);

        $alias = $event->getTitle() . self::SEPARATOR_OFFSET . dechex(intval($event->getID()));

        return $this->cleanUrl($alias);
    }
1346369
public function updateIndexAlias(): void
    {
        $aliasName = $this->searchClient->getIndexName(); // The alias name is the unprefixed index name
        if ($this->getIndexName() === $aliasName) {
            throw new Exception('UpdateIndexAlias is only allowed to be called when $this->setIndexNamePostfix has been created.', 1383649061);
        }

        if (!$this->getIndex()->exists()) {
            throw new Exception('The target index for updateIndexAlias does not exist. This shall never happen.', 1383649125);
        }

        $aliasActions = [];
        try {
            $indexNames = $this->indexDriver->indexesByAlias($aliasName);

            if ($indexNames === []) {
                // if there is an actual index with the name we want to use as alias, remove it now
                $this->indexDriver->deleteIndex($aliasName);
            } else {
                foreach ($indexNames as $indexName) {
                    $aliasActions[] = [
                        'remove' => [
                            'index' => $indexName,
                            'alias' => $aliasName
                        ]
                    ];
                }
            }
        } catch (ApiException $exception) {
            // in case of 404, do not throw an error...
            if ($exception->getResponse()->getStatusCode() !== 404) {
                throw $exception;
            }
        }

        $aliasActions[] = [
            'add' => [
                'index' => $this->getIndexName(),
                'alias' => $aliasName
            ]
        ];

        $this->indexDriver->aliasActions($aliasActions);
    }
1194421
public static function hash($alias,$key,$value=''){
        if(isset(self::$pool[$alias]) && isset(self::$pool[$alias][$key])) {
            return self::$pool[$alias][$key];
        }
        if($value instanceof \Closure){
            $value = $value();
        }
        return self::$pool[$alias][$key] = $value;
    }
826249
public function alias($alias, $name) {
		if (is_array($alias)) {
			foreach ($alias as $key) {
				$this->alias($key, $name);
			}

			return;
		}

		$this->aliases[$alias] = $name;
	}
114630
public function execute($value)
    {
        if (!is_array($value) || count($value) != 2) {
            throw new \Exception('Value for number range comparison should have to values');
        }

        $queryBuilder = $this->getQueryBuilder();

        if (!empty($value[0])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->gte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_1"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_1",
                    (float) $value[0]
                );
        }

        if (!empty($value[1])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->lte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_2"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_2",
                    (float) $value[1]
                );
        }
    }
175063
public static function makeAliasSendInstance(string $alias, float $value, string $message = ''): self
    {
        $transaction = new self();

        $transaction->setVersion(Version::ALIAS_SEND);
        $transaction->setDestinationAddress($alias);
        $transaction->setValue($value);
        $transaction->setMessage($message);

        return $transaction;
    }
576147
public function setSandbox($value)
    {
        if (is_bool($value)) {
            $this->config['sandbox'] = $value;
        } else {
            throw new \Exception('sandbox value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value');
        }
    }
337979
public static function alias($path, $value = null)
    {
        // get path by alias
        if (\is_string($path) && !$value) {
            // don't use alias
            if ($path[0] !== '@') {
                return $path;
            }

            $sep = '/';
            $path = str_replace(['/', '\\'], $sep, $path);

            // only a alias. e.g. @project
            if (!strpos($path, $sep)) {
                return self::$aliases[$path] ?? $path;
            }

            // have other partial. e.g: @project/temp/logs
            $realPath = $path;
            list($alias, $other) = explode($sep, $path, 2);

            if (isset(self::$aliases[$alias])) {
                $realPath = self::$aliases[$alias] . $sep . $other;
            }

            return $realPath;
        }

        if ($path && $value && \is_string($path) && \is_string($value)) {
            $path = [$path => $value];
        }

        // custom set path's alias. e.g: Slim::alias([ 'alias' => 'path' ]);
        if (\is_array($path)) {
            /**
             * @var string $alias
             * @var string $realPath
             */
            foreach ($path as $alias => $realPath) {
                // 1th char must is '@'
                if ($alias[0] !== '@') {
                    continue;
                }

                self::$aliases[$alias] = self::alias($realPath);
            }
        }

        return true;
    }
1209847
public function andWhere($field, $operation, $value = null, $alias = self::DEFAULT_TABLE_ALIAS)
    {
        if (strpos($field, '.') > 0) {
            //monta os joins
            $this->fieldValue = [
                'value'     => $value,
                'operation' => $operation,
            ];
            $newAliasField = $this->associationQueryFields($field);
            $alias = $newAliasField['alias'];
            $field = $newAliasField['field'];
        }
        $this->queryBuilder->andWhere($this->makeExpression($field, $operation, $value, $alias));

        return $this;
    }
445424
public function setUrl($value)
    {
        if (filter_var($value, FILTER_VALIDATE_URL) === false) {
            throw new \PHPUnit_Framework_Exception("Url is not valid.\n");
        }

        $this->url = $value;
    }
1039377
public function globalise($alias = null)
    {
        if (!is_null($alias)){
            if (substr($alias, 0, 1) != '\\')
                $alias = '\\' . $alias;
            if (class_exists($alias))
                throw new \Exception('Class already exists!');
            class_alias(get_class($this), $alias);
        }
        self::$instance = $this;
    }
436787
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->_args[count($this->_args)] = $value;
        } else {
            if (is_int($offset)) {
                $this->_args[$offset] = $value;
            } else {
                throw new \Exception('Cannot set offset \''.$offset.'\' of IndexedArray.');
            }
        }
    }
780371
private function setQueryField($meta, $value, $alias)
    {
        $campo = $this->getFullFieldName($value, $alias);

        if ($meta->isSingleValuedAssociation($value) && $value != $alias) {
            $targetField = $meta->getAssociationMapping($value)['joinColumns'][0]['referencedColumnName'];
            $alias = $alias == self::DEFAULT_TABLE_ALIAS ? substr($campo, strpos($campo, '.') + 1) : $alias.'_'.$targetField;
            $campo = 'IDENTITY('.$campo.') '.$alias;
        } elseif ($this->position > 0) {
            $campo = '('.$campo.') AS '.$alias.'_'.$value;
        }
        // acrescenta o campo ao select
        $this->queryFields[] = $campo;
    }
1024583
public function setValue($value)
    {
        $matches = $this->parseKeywordText($value);
        if(isset($matches['keywords']))
        {
            if(isset($matches['keywords'][0]))
            {
                $this->database = $matches['keywords'][0];
            }
            $this->alias = $matches['alias'];
        }
    }