-
Notifications
You must be signed in to change notification settings - Fork 0
API Services IConfigService
Christophe SAUVEUR edited this page Sep 29, 2024
·
1 revision
interface IConfigService
Configuration service interface
Since 2.0
public const DEFAULT_DOMAIN = '__default';
Since 2.0
public abstract function getValue(string $property, mixed $default = null, ?string $domain = null): mixed
Gets the value of a configuration property
Since 2.0
Name | Type | Description |
---|---|---|
$property |
string |
Name of the propery |
$default |
mixed |
Default value if the property does not exist in the loaded configuration (Defaults to NULL) |
$domain |
`string | null` |
mixed
public abstract function hasValue(string $property, ?string $domain = null): bool
Determines if a property has been loaded in the configuration
Since 2.0
Name | Type | Description |
---|---|---|
$property |
string |
Name of the propery |
$domain |
`string | null` |
bool
true if the property exists in the loaded configuration, false either
public abstract function load(Config $configData, string $domain = 'self::DEFAULT_DOMAIN')
Loads configuration properties
Since 2.0
Name | Type | Description |
---|---|---|
$configData |
Config |
Config data |
$domain |
string |
Domain name |
public abstract function tryGetValue(string $property, mixed &$outValue, ?string $domain = null): bool
Tries to get the value of a configuration property
Since 2.0
Name | Type | Description |
---|---|---|
$property |
string |
Name of the propery |
$outValue |
mixed |
Reference to the variable containing the property value if existing |
$domain |
`string | null` |
bool
true if the property exists in the loaded configuration, or false either
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license