getAlias() публичный Метод

Finds an entry of the container by the given alias and returns it.
public getAlias ( string $alias ) : mixed
$alias string Alias of the entry to look for.
Результат mixed
Пример #1
0
 /**
  * {@inheritDoc}
  * @throws BeanException
  * @throws BeanNotFoundException
  */
 public function get($id)
 {
     if (!is_string($id) || empty($id)) {
         throw new BeanException('Id must be a non-empty string.');
     }
     $instance = null;
     try {
         if (is_callable([$this->beanConfig, $id])) {
             $instance = $this->beanConfig->{$id}();
         } elseif ($this->beanConfig->hasAlias($id)) {
             $instance = $this->beanConfig->getAlias($id);
         }
     } catch (\Throwable $e) {
         $message = sprintf('Exception occurred while instantiating "%s": %s', $id, $e->getMessage());
         throw new BeanException($message, $e->getCode(), $e);
     }
     if (null === $instance) {
         throw new BeanNotFoundException(sprintf('"%s" is not defined!', $id));
     }
     return $instance;
 }