PHP Class eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver

This is useful to get a setting for a specific siteaccess for example. It will check the different scopes available for a given namespace to find the appropriate parameter. To work, the dynamic setting must comply internally to the following name format : "..parameter.name". - is the namespace for your dynamic setting. Defaults to "ezsettings", but can be anything. - is basically the siteaccess name you want your parameter value to apply to. Can also be "global" for a global override. Another scope is used internally: "default". This is the generic fallback. The resolve scope order is the following: 1. "global" 2. SiteAccess name 3. "default"
Inheritance: implements eZ\Publish\Core\MVC\Symfony\Configuration\VersatileScopeInterface, implements eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessAware, implements Symfony\Component\DependencyInjection\ContainerAwareInterface, use trait Symfony\Component\DependencyInjection\ContainerAwareTrait
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$defaultNamespace string
$defaultScope string
$groupsBySiteAccess Siteaccess groups, indexed by siteaccess name
$siteAccess eZ\Publish\Core\MVC\Symfony\SiteAccess
$undefinedStrategy integer

Méthodes publiques

Méthode Description
__construct ( array $groupsBySiteAccess, string $defaultNamespace, integer $undefinedStrategy = self::UNDEFINED_STRATEGY_EXCEPTION )
getDefaultNamespace ( ) : string
getDefaultScope ( )
getParameter ( string $paramName, string $namespace = null, string $scope = null ) : mixed Returns value for $paramName, in $namespace.
getUndefinedStrategy ( ) : integer
hasParameter ( string $paramName, string $namespace = null, string $scope = null ) : boolean Checks if $paramName exists in $namespace.
setDefaultNamespace ( string $defaultNamespace ) Changes the default namespace to look parameter into.
setDefaultScope ( $scope )
setSiteAccess ( SiteAccess $siteAccess = null )
setUndefinedStrategy ( integer $undefinedStrategy ) Sets the strategy to use if an undefined parameter is being asked.

Method Details

__construct() public méthode

public __construct ( array $groupsBySiteAccess, string $defaultNamespace, integer $undefinedStrategy = self::UNDEFINED_STRATEGY_EXCEPTION )
$groupsBySiteAccess array SiteAccess groups, indexed by siteaccess.
$defaultNamespace string The default namespace
$undefinedStrategy integer Strategy to use when encountering undefined parameters. Must be one of - ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION (throw an exception) - ConfigResolver::UNDEFINED_STRATEGY_NULL (return null)

getDefaultNamespace() public méthode

public getDefaultNamespace ( ) : string
Résultat string

getDefaultScope() public méthode

public getDefaultScope ( )

getParameter() public méthode

Returns value for $paramName, in $namespace.
public getParameter ( string $paramName, string $namespace = null, string $scope = null ) : mixed
$paramName string The parameter name, without $prefix and the current scope (i.e. siteaccess name).
$namespace string Namespace for the parameter name. If null, the default namespace will be used.
$scope string The scope you need $paramName value for. It's typically the siteaccess name. If null, the current siteaccess name will be used.
Résultat mixed

getUndefinedStrategy() public méthode

public getUndefinedStrategy ( ) : integer
Résultat integer

hasParameter() public méthode

Checks if $paramName exists in $namespace.
public hasParameter ( string $paramName, string $namespace = null, string $scope = null ) : boolean
$paramName string
$namespace string If null, the default namespace should be used.
$scope string The scope you need $paramName value for. It's typically the siteaccess name. If null, the current siteaccess name will be used.
Résultat boolean

setDefaultNamespace() public méthode

Changes the default namespace to look parameter into.
public setDefaultNamespace ( string $defaultNamespace )
$defaultNamespace string

setDefaultScope() public méthode

public setDefaultScope ( $scope )

setSiteAccess() public méthode

public setSiteAccess ( SiteAccess $siteAccess = null )
$siteAccess eZ\Publish\Core\MVC\Symfony\SiteAccess

setUndefinedStrategy() public méthode

Can be one of: - ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION (throw an exception) - ConfigResolver::UNDEFINED_STRATEGY_NULL (return null). Defaults to ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION.
public setUndefinedStrategy ( integer $undefinedStrategy )
$undefinedStrategy integer

Property Details

$defaultNamespace protected_oe property

protected string $defaultNamespace
Résultat string

$defaultScope protected_oe property

protected string $defaultScope
Résultat string

$groupsBySiteAccess protected_oe property

Siteaccess groups, indexed by siteaccess name
protected $groupsBySiteAccess

$siteAccess protected_oe property

protected SiteAccess,eZ\Publish\Core\MVC\Symfony $siteAccess
Résultat eZ\Publish\Core\MVC\Symfony\SiteAccess

$undefinedStrategy protected_oe property

protected int $undefinedStrategy
Résultat integer