symfony API

sfNamespacedParameterHolder Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfNamespacedParameterHolder provides a class for managing parameters with support for namespaces.

Inheritence

sfNamespacedParameterHolder  <  sfParameterHolder

Method Summary

  • add($parameters, $ns = null)
    Set an array of parameters.
  • addByRef(&amp;$parameters, $ns = null, $parameters)
    Set an array of parameters by reference.
  • clear()
    Clear all parameters associated with this request.
  • mixed&amp; get($name, $default = null, $ns = null)
    Retrieve a parameter with an optionally specified namespace.
  • array&amp; getAll($ns = null)
    Retrieve an array of parameters, within a namespace.
  • string getDefaultNamespace()
    Get the default namespace value.
  • array getNames($ns = null)
    Retrieve an array of parameter names from an optionally specified namespace.
  • array getNamespaces()
    Retrieve an array of parameter namespaces.
  • bool has($name, $ns = null)
    Indicates whether or not a parameter exists.
  • bool hasNamespace($ns)
    Indicates whether or not A parameter namespace exists.
  • string remove($name, $default = null, $ns = null)
    Remove a parameter.
  • removeNamespace($ns = null)
    Remove A parameter namespace and all of its associated parameters.
  • array serialize()
    Serializes the current instance.
  • set($name, $value, $ns = null)
    Set a parameter.
  • setByRef($name, &amp;$value, $ns = null, $value)
    Set a parameter by reference.
  • setDefaultNamespace($namespace, $move = true)
    Sets the default namespace value.
  • unserialize($serialized)
    Unserializes a sfNamespacedParameterHolder instance.
  • __construct($namespace = &apos;symfony/default&apos;)
    The constructor for sfNamespacedParameterHolder.

Methods inherited from sfParameterHolder

add , addByRef , clear , get , getAll , getNames , has , remove , serialize , set , setByRef , unserialize , __construct

Method Details

  • add ($parameters, $ns = null) Browse code

    $parameters An associative array of parameters and their associated values
    $ns A parameter namespace

    Set an array of parameters.


    If an existing parameter name matches any of the keys in the supplied array, the associated value will be overridden.

  • addByRef (&$parameters, $ns = null, $parameters) Browse code

    &$parameters
    $ns A parameter namespace
    $parameters An associative array of parameters and references to their associated values

    Set an array of parameters by reference.


    If an existing parameter name matches any of the keys in the supplied array, the associated value will be overridden.

  • clear () Browse code

    Clear all parameters associated with this request.

  • (mixed&amp;) get ($name, $default = null, $ns = null) Browse code

    $name A parameter name
    $default A default parameter value
    $ns A parameter namespace

    Retrieve a parameter with an optionally specified namespace.


    An isolated namespace may be identified by providing a value for the third argument. If not specified, the default namespace 'symfony/default' is used.

    returns A parameter value, if the parameter exists, otherwise null

  • (array&amp;) getAll ($ns = null) Browse code

    $ns A parameter namespace

    Retrieve an array of parameters, within a namespace.


    This method is limited to a namespace. Without any argument, it returns the parameters of the default namespace. If a namespace is passed as an argument, only the parameters of the specified namespace are returned.

    returns An associative array of parameters

  • (string) getDefaultNamespace () Browse code

    Get the default namespace value.


    The $default_namespace is defined as 'symfony/default'.

    returns The default namespace

  • (array) getNames ($ns = null) Browse code

    $ns A parameter namespace.

    Retrieve an array of parameter names from an optionally specified namespace.

    returns An indexed array of parameter names, if the namespace exists, otherwise null

  • (array) getNamespaces () Browse code

    Retrieve an array of parameter namespaces.

    returns An indexed array of parameter namespaces

  • (bool) has ($name, $ns = null) Browse code

    $name A parameter name
    $ns A parameter namespace

    Indicates whether or not a parameter exists.

    returns true, if the parameter exists, otherwise false

  • (bool) hasNamespace ($ns) Browse code

    $ns A parameter namespace

    Indicates whether or not A parameter namespace exists.

    returns true, if the namespace exists, otherwise false

  • (string) remove ($name, $default = null, $ns = null) Browse code

    $name A parameter name
    $default A default parameter value
    $ns A parameter namespace

    Remove a parameter.

    returns A parameter value, if the parameter was removed, otherwise null

  • removeNamespace ($ns = null) Browse code

    $ns A parameter namespace.

    Remove A parameter namespace and all of its associated parameters.

  • (array) serialize () Browse code

    Serializes the current instance.

    returns Objects instance

  • set ($name, $value, $ns = null) Browse code

    $name A parameter name
    $value A parameter value
    $ns A parameter namespace

    Set a parameter.


    If a parameter with the name already exists the value will be overridden.

  • setByRef ($name, &$value, $ns = null, $value) Browse code

    $name A parameter name
    &$value
    $ns A parameter namespace
    $value A reference to a parameter value

    Set a parameter by reference.


    If a parameter with the name already exists the value will be overridden.

  • setDefaultNamespace ($namespace, $move = true) Browse code

    $namespace Default namespace
    $move Move all values of the old default namespace to the new one or not

    Sets the default namespace value.

  • unserialize ($serialized) Browse code

    $serialized A serialized sfNamespacedParameterHolder instance

    Unserializes a sfNamespacedParameterHolder instance.

  • __construct ($namespace = 'symfony/default') Browse code

    $namespace

    The constructor for sfNamespacedParameterHolder.


    The default namespace may be overridden at initialization as follows:

     <?php
    
    $mySpecialPH = new sfNamespacedParameterHolder('symfony/special');
    ?>