You are here

class Alias in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Alias.php \Symfony\Component\DependencyInjection\Alias

@api

Hierarchy

  • class \Symfony\Component\DependencyInjection\Alias

Expanded class hierarchy of Alias

14 files declare their use of Alias
AutoAliasServicePass.php in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/AutoAliasServicePass.php
BackendCompilerPass.php in lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php
Contains \Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass.
ContainerBuilderTest.php in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
DecoratorServicePass.php in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php
DecoratorServicePassTest.php in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php

... See full list

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Alias.php, line 17

Namespace

Symfony\Component\DependencyInjection
View source
class Alias {
  private $id;
  private $public;

  /**
   * Constructor.
   *
   * @param string $id     Alias identifier
   * @param bool   $public If this alias is public
   *
   * @api
   */
  public function __construct($id, $public = true) {
    $this->id = strtolower($id);
    $this->public = $public;
  }

  /**
   * Checks if this DI Alias should be public or not.
   *
   * @return bool
   *
   * @api
   */
  public function isPublic() {
    return $this->public;
  }

  /**
   * Sets if this Alias is public.
   *
   * @param bool $boolean If this Alias should be public
   *
   * @api
   */
  public function setPublic($boolean) {
    $this->public = (bool) $boolean;
  }

  /**
   * Returns the Id of this alias.
   *
   * @return string The alias id
   *
   * @api
   */
  public function __toString() {
    return $this->id;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Alias::$id private property
Alias::$public private property
Alias::isPublic public function Checks if this DI Alias should be public or not.
Alias::setPublic public function Sets if this Alias is public.
Alias::__construct public function Constructor.
Alias::__toString public function Returns the Id of this alias.