This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/Alias.php

61 lines
1.2 KiB
PHP
Raw Normal View History

2011-01-07 14:44:29 +00:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2011-01-07 14:44:29 +00:00
namespace Symfony\Component\DependencyInjection;
class Alias
{
private $id;
private $public;
2011-01-07 14:44:29 +00:00
2011-02-13 18:06:41 +00:00
/**
* Constructor.
*
* @param string $id Alias identifier
2011-04-27 06:25:26 +01:00
* @param Boolean $public If this alias is public
2011-02-13 18:06:41 +00:00
*/
2011-01-07 14:44:29 +00:00
public function __construct($id, $public = true)
{
$this->id = strtolower($id);
$this->public = $public;
}
2011-02-13 18:06:41 +00:00
/**
* Checks if this DI Alias should be public or not.
*
2011-04-27 06:25:26 +01:00
* @return Boolean
2011-02-13 18:06:41 +00:00
*/
2011-01-07 14:44:29 +00:00
public function isPublic()
{
return $this->public;
}
2011-02-13 18:06:41 +00:00
/**
* Sets if this Alias is public.
*
2011-04-27 06:25:26 +01:00
* @param Boolean $boolean If this Alias should be public
2011-02-13 18:06:41 +00:00
*/
2011-01-07 14:44:29 +00:00
public function setPublic($boolean)
{
$this->public = (Boolean) $boolean;
}
2011-02-13 18:06:41 +00:00
/**
* Returns the Id of this alias.
*
* @return string The alias id
*/
2011-01-07 14:44:29 +00:00
public function __toString()
{
return $this->id;
}
}