phpDocumentor

ConfigurationCompatibilityService

Class ConfigurationCompatibilityService

Tags
deprecated

This service is deprecated and should not be used to avoid extra database connection. Use \Gambio\Core\Configuration\Services\ConfigurationService for new domains and gm_get_conf function in old code.

codeCoverageIgnore

Table of Contents

$connection  : Connection
$gmConfigCache  : array<string|int, mixed>
__construct()  : mixed
ConfigurationCompatibilityService constructor.
gmGetConf()  : array<string|int, string>|string|false|null
buildGmArray()  : array<string|int, mixed>
Builds the internal data array that holds all configuration until the request is finished or a rebuild is requested.
buildGmCache()  : void
Rebuilds the cached data of the gm_configuration namespace.
isEmptyGmCache()  : bool
Checks if the cached data of the gm_configuration namespace is empty.
isValidKeyAndType()  : bool
Validates the $key and $type argument.
shouldReturnArray()  : bool
Checks the $key argument. If it is an array, multiple configurations are requested.
shouldReturnAssoc()  : bool
Checks the $type argument that determines the format of the returned array if multiple configurations are requested.

Properties

Methods

__construct()

ConfigurationCompatibilityService constructor.

public __construct(Connection $connection) : mixed
Parameters
$connection : Connection
Return values
mixed

gmGetConf()

public gmGetConf(string|array<string|int, mixed> $key[, string $type = 'ASSOC' ][, bool $rebuildCache = false ]) : array<string|int, string>|string|false|null
Parameters
$key : string|array<string|int, mixed>
$type : string = 'ASSOC'
$rebuildCache : bool = false
Return values
array<string|int, string>|string|false|null

buildGmArray()

Builds the internal data array that holds all configuration until the request is finished or a rebuild is requested.

private buildGmArray(array<string|int, mixed> $keys, string $type) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>
$type : string
Return values
array<string|int, mixed>

isEmptyGmCache()

Checks if the cached data of the gm_configuration namespace is empty.

private isEmptyGmCache() : bool
Return values
bool

isValidKeyAndType()

Validates the $key and $type argument.

private isValidKeyAndType(mixed $key, string $type) : bool

The argument $key can be either of type string or an array of strings to request multiple configurations. The $type argument is an enum value and expected to be either "NUMERIC" or "ASSOC".

Parameters
$key : mixed
$type : string
Return values
bool

shouldReturnArray()

Checks the $key argument. If it is an array, multiple configurations are requested.

private shouldReturnArray( $key) : bool
Parameters
$key :
Return values
bool

shouldReturnAssoc()

Checks the $type argument that determines the format of the returned array if multiple configurations are requested.

private shouldReturnAssoc(string $type) : bool
Parameters
$type : string
Return values
bool

Search results