Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver Class Reference

This class will help you get settings for a specific scope. More...

Inheritance diagram for eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver:

## Public Member Functions
| __construct (array $groupsBySiteAccess, $defaultNamespace, $undefinedStrategy=self::UNDEFINED_STRATEGY_EXCEPTION)
| setSiteAccess (SiteAccess $siteAccess=null)
| setUndefinedStrategy ($undefinedStrategy)
| Sets the strategy to use if an undefined parameter is being asked. More...
| getUndefinedStrategy ()
| hasParameter ($paramName, $namespace=null, $scope=null)
| Checks if $paramName exists in $namespace. More...
| getParameter ($paramName, $namespace=null, $scope=null)
| Returns value for $paramName, in $namespace. More...
| setDefaultNamespace ($defaultNamespace)
| Changes the default namespace to look parameter into. More...
| getDefaultNamespace ()
| getDefaultScope ()
| Returns current default scope. More...
| setDefaultScope ($scope)

## Public Attributes
const | SCOPE_GLOBAL = 'global'
const | SCOPE_DEFAULT = 'default'
const | UNDEFINED_STRATEGY_EXCEPTION = 1
const | UNDEFINED_STRATEGY_NULL = 2

## Protected Attributes
| $siteAccess
| $groupsBySiteAccess
| $defaultNamespace
| $defaultScope
| $undefinedStrategy

## Private Member Functions
| warnAboutTooEarlyLoadedParams ()
| logTooEarlyLoadedListIfNeeded ($paramName)
| If in run-time debug mode, before SiteAccess is initialized, log getParameter() usages when considered "unsafe". More...

## Private Attributes
| $tooEarlyLoadedList = []

## Detailed Description

This class will help you get settings for a specific scope.

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 : "<namespace>.<scope>.parameter.name".

- <namespace> is the namespace for your dynamic setting. Defaults to "ezsettings", but can be anything.
- <scope> 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"

Definition at line 34 of file ConfigResolver.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::__construct | ( | array | $groupsBySiteAccess,
|  |  | $defaultNamespace,
|  |  | $undefinedStrategy = `self::UNDEFINED_STRATEGY_EXCEPTION`
| ) |  |

Parameters

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

Definition at line 70 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$defaultNamespace, eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$groupsBySiteAccess, and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$undefinedStrategy.

## Member Function Documentation

## ◆ getDefaultNamespace()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::getDefaultNamespace | ( |  | ) |

Returns
  string

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

Definition at line 224 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$defaultNamespace.

## ◆ getDefaultScope()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::getDefaultScope | ( |  | ) |

Returns current default scope.

Returns
  string

Implements eZ\Publish\Core\MVC\Symfony\Configuration\VersatileScopeInterface.

Definition at line 229 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter(), and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\hasParameter().

## ◆ getParameter()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::getParameter | ( |  | $paramName,
|  |  | $namespace = `null`,
|  |  | $scope = `null`
| ) |  |

Returns value for $paramName, in $namespace.

Parameters

  string | $paramName | The parameter name, without $prefix and the current scope (i.e. siteaccess name).
  string | $namespace | Namespace for the parameter name. If null, the default namespace will be used.
  string | $scope | The scope you need $paramName value for. It's typically the siteaccess name. If null, the current siteaccess name will be used.

Exceptions

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

Definition at line 158 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$defaultNamespace, eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getDefaultScope(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\logTooEarlyLoadedListIfNeeded(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\SCOPE_GLOBAL, eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\UNDEFINED_STRATEGY_EXCEPTION, and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\UNDEFINED_STRATEGY_NULL.

## ◆ getUndefinedStrategy()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::getUndefinedStrategy | ( |  | ) |

Returns
  int

Definition at line 103 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$undefinedStrategy.

## ◆ hasParameter()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::hasParameter | ( |  | $paramName,
|  |  | $namespace = `null`,
|  |  | $scope = `null`
| ) |  |

Checks if $paramName exists in $namespace.

Parameters

  string | $paramName |
  string | $namespace | If null, the default namespace should be used.
  string | $scope | The scope you need $paramName value for. It's typically the siteaccess name. If null, the current siteaccess name will be used.

Returns
  bool

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

Definition at line 118 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$defaultNamespace, and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getDefaultScope().

## ◆ logTooEarlyLoadedListIfNeeded()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::logTooEarlyLoadedListIfNeeded | ( |  | $paramName | ) |
| private

If in run-time debug mode, before SiteAccess is initialized, log getParameter() usages when considered "unsafe".

Returns
  string

Definition at line 274 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter().

## ◆ setDefaultNamespace()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::setDefaultNamespace | ( |  | $defaultNamespace | ) |

Changes the default namespace to look parameter into.

Parameters

  string | $defaultNamespace |

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

Definition at line 216 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$defaultNamespace.

## ◆ setDefaultScope()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::setDefaultScope | ( |  | $scope | ) |

Parameters

  string | $scope | The default "scope" aka siteaccess name, as opposed to the self::SCOPE_DEFAULT.

Implements eZ\Publish\Core\MVC\Symfony\Configuration\VersatileScopeInterface.

Definition at line 237 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\warnAboutTooEarlyLoadedParams().

## ◆ setSiteAccess()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::setSiteAccess | ( | SiteAccess | $siteAccess = `null` | ) |

Implements eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessAware.

Definition at line 80 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$siteAccess.

## ◆ setUndefinedStrategy()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::setUndefinedStrategy | ( |  | $undefinedStrategy | ) |

Sets the strategy to use if an undefined parameter is being asked.

Can be one of:

- ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION (throw an exception)
- ConfigResolver::UNDEFINED_STRATEGY_NULL (return null).

Defaults to ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION.

Parameters

  int | $undefinedStrategy |

Definition at line 95 of file ConfigResolver.php.

References eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\$undefinedStrategy.

## ◆ warnAboutTooEarlyLoadedParams()

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::warnAboutTooEarlyLoadedParams | ( |  | ) |
| private

Definition at line 247 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\setDefaultScope().

## Member Data Documentation

## ◆ $defaultNamespace

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$defaultNamespace
| protected

Definition at line 51 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\__construct(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getDefaultNamespace(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\hasParameter(), and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\setDefaultNamespace().

## ◆ $defaultScope

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$defaultScope
| protected

Definition at line 54 of file ConfigResolver.php.

## ◆ $groupsBySiteAccess

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$groupsBySiteAccess
| protected

Definition at line 48 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\__construct().

## ◆ $siteAccess

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$siteAccess
| protected

Definition at line 45 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\setSiteAccess().

## ◆ $tooEarlyLoadedList

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$tooEarlyLoadedList = []
| private

Definition at line 60 of file ConfigResolver.php.

## ◆ $undefinedStrategy

eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::$undefinedStrategy
| protected

Definition at line 57 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\__construct(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getUndefinedStrategy(), and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\setUndefinedStrategy().

## ◆ SCOPE_DEFAULT

const eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::SCOPE_DEFAULT = 'default'

Definition at line 39 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Contextualizer\mapConfigArray(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\LocationView\preMap(), and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Page\preMap().

## ◆ SCOPE_GLOBAL

const eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::SCOPE_GLOBAL = 'global'

Definition at line 38 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter(), eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Contextualizer\mapConfigArray(), and eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\LocationView\preMap().

## ◆ UNDEFINED_STRATEGY_EXCEPTION

const eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION = 1

Definition at line 41 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter().

## ◆ UNDEFINED_STRATEGY_NULL

const eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver::UNDEFINED_STRATEGY_NULL = 2

Definition at line 42 of file ConfigResolver.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver\getParameter().

The documentation for this class was generated from the following file:

- ConfigResolver.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.