Class

PropelConfiguration

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

Parameters

array $parameters

at line 50
public boolean offsetExists(integer $offset)

Parameters

integer $offset

Return Value

boolean

See also

http://www.php.net/ArrayAccess

at line 61
public offsetSet(integer $offset, mixed $value)

Parameters

integer $offset
mixed $value

See also

http://www.php.net/ArrayAccess

at line 74
public array offsetGet(integer $offset)

Parameters

integer $offset

Return Value

array

See also

http://www.php.net/ArrayAccess

at line 84
public offsetUnset(integer $offset)

Parameters

integer $offset

See also

http://www.php.net/ArrayAccess

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'

Parameters

string $name Parameter name
mixed $default Default value to be used if the requested value is not found

Return Value

mixed Parameter value or the default

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')

Parameters

string $name Configuration item name (name.space.name)
mixed $value Value to be stored
Boolean $autoFlattenArrays

at line 154
public mixed getParameters(integer $type = PropelConfiguration::TYPE_ARRAY)

Parameters

integer $type

Return Value

mixed

Exceptions

PropelException

at line 171
public array getFlattenedParameters()

Return Value

array