2010-06-27 17:28:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2011-01-15 13:29:43 +00:00
|
|
|
* This file is part of the Symfony package.
|
2010-06-27 17:28:29 +01:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2010-06-27 17:28:29 +01:00
|
|
|
*
|
2011-01-15 13:29:43 +00:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2010-06-27 17:28:29 +01:00
|
|
|
*/
|
|
|
|
|
2011-01-15 13:29:43 +00:00
|
|
|
namespace Symfony\Component\DependencyInjection\ParameterBag;
|
|
|
|
|
2011-05-17 15:26:08 +01:00
|
|
|
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
|
2011-04-26 11:31:40 +01:00
|
|
|
|
2010-06-27 17:28:29 +01:00
|
|
|
/**
|
|
|
|
* ParameterBagInterface.
|
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
2010-06-27 17:28:29 +01:00
|
|
|
*/
|
|
|
|
interface ParameterBagInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Clears all parameters.
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function clear();
|
2010-06-27 17:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds parameters to the service container parameters.
|
|
|
|
*
|
|
|
|
* @param array $parameters An array of parameters
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function add(array $parameters);
|
2010-06-27 17:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the service container parameters.
|
|
|
|
*
|
|
|
|
* @return array An array of parameters
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function all();
|
2010-06-27 17:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a service container parameter.
|
|
|
|
*
|
|
|
|
* @param string $name The parameter name
|
|
|
|
*
|
|
|
|
* @return mixed The parameter value
|
|
|
|
*
|
2011-05-17 15:26:08 +01:00
|
|
|
* @throws ParameterNotFoundException if the parameter is not defined
|
2010-06-27 17:28:29 +01:00
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function get($name);
|
2010-06-27 17:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a service container parameter.
|
|
|
|
*
|
2011-04-23 16:05:44 +01:00
|
|
|
* @param string $name The parameter name
|
|
|
|
* @param mixed $value The parameter value
|
2010-06-27 17:28:29 +01:00
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function set($name, $value);
|
2010-06-27 17:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if a parameter name is defined.
|
|
|
|
*
|
|
|
|
* @param string $name The parameter name
|
|
|
|
*
|
|
|
|
* @return Boolean true if the parameter name is defined, false otherwise
|
|
|
|
*/
|
2010-10-17 12:39:51 +01:00
|
|
|
function has($name);
|
2011-05-10 01:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Replaces parameter placeholders (%name%) by their values for all parameters.
|
|
|
|
*/
|
2011-05-10 12:55:08 +01:00
|
|
|
function resolve();
|
2011-05-10 01:34:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Replaces parameter placeholders (%name%) by their values.
|
|
|
|
*
|
|
|
|
* @param mixed $value A value
|
|
|
|
*
|
2011-05-17 15:26:08 +01:00
|
|
|
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
|
2011-05-10 01:34:02 +01:00
|
|
|
*/
|
2011-05-10 12:55:08 +01:00
|
|
|
function resolveValue($value);
|
2010-06-27 17:28:29 +01:00
|
|
|
}
|