class PropelConfiguration implements ArrayAccess
PropelConfiguration is a container for all Propel's runtime configuration data.
PropelConfiguration implements ArrayAccess interface so the configuration can be accessed as an array or using a simple getter and setter. The whole configuration can also be retrieved as a nested arrays, flat array or as a PropelConfiguration instance.
Constants
TYPE_ARRAY |
|
TYPE_ARRAY_FLAT |
|
TYPE_OBJECT |
|
Methods
__construct(array $parameters = array())
Construct a new configuration container |
||
boolean |
offsetExists(integer $offset)
|
|
offsetSet(integer $offset, mixed $value)
|
||
array |
offsetGet(integer $offset)
|
|
offsetUnset(integer $offset)
|
||
mixed |
getParameter(string $name, mixed $default = null)
Get a value from the container, using a namespaced key. |
|
setParameter(string $name, mixed $value, Boolean $autoFlattenArrays = true)
Store a value to the container. |
||
mixed |
getParameters(integer $type = PropelConfiguration::TYPE_ARRAY)
|
|
array |
getFlattenedParameters()
|
Details
at line 38
public
__construct(array $parameters = array())
Construct a new configuration container
at line 50
public boolean
offsetExists(integer $offset)
at line 61
public
offsetSet(integer $offset, mixed $value)
at line 74
public array
offsetGet(integer $offset)
at line 84
public
offsetUnset(integer $offset)
at line 107
public mixed
getParameter(string $name, mixed $default = null)
Get a value from the container, using a namespaced key.
If the specified value is supposed to be an array, the actual return value will be null.
Examples:
$c['foo'] = 'bar';
echo $c->getParameter('foo'); => 'bar'
$c['foo1'] = array('foo2' => 'bar');
echo $c->getParameter('foo1'); => null
echo $c->getParameter('foo1.foo2'); => 'bar'
at line 131
public
setParameter(string $name, mixed $value, Boolean $autoFlattenArrays = true)
Store a value to the container.
Accept scalar and array values.
Examples:
$c->setParameter('foo', 'bar');
echo $c['foo']; => 'bar'
$c->setParameter('foo1.foo2', 'bar');
print_r($c['foo1']); => array('foo2' => 'bar')
at line 154
public mixed
getParameters(integer $type = PropelConfiguration::TYPE_ARRAY)
at line 171
public array
getFlattenedParameters()