Drupal investigation

Alias.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection;
  11. class Alias
  12. {
  13. private $id;
  14. private $public;
  15. /**
  16. * @param string $id Alias identifier
  17. * @param bool $public If this alias is public
  18. */
  19. public function __construct($id, $public = true)
  20. {
  21. $this->id = strtolower($id);
  22. $this->public = $public;
  23. }
  24. /**
  25. * Checks if this DI Alias should be public or not.
  26. *
  27. * @return bool
  28. */
  29. public function isPublic()
  30. {
  31. return $this->public;
  32. }
  33. /**
  34. * Sets if this Alias is public.
  35. *
  36. * @param bool $boolean If this Alias should be public
  37. */
  38. public function setPublic($boolean)
  39. {
  40. $this->public = (bool) $boolean;
  41. }
  42. /**
  43. * Returns the Id of this alias.
  44. *
  45. * @return string The alias id
  46. */
  47. public function __toString()
  48. {
  49. return $this->id;
  50. }
  51. }