ConfigurationService
in
Interface ConfigurationService
Table of Contents
- delete() : void
- Deletes configurations.
- find() : Configuration
- Searches for a configuration.
- findLanguageDependent() : LanguageDependentConfiguration|null
- Searches for a language dependent configuration.
- has() : bool
- Checks if a configuration with the given key exists.
- hasLanguageDependent() : bool
- Checks if a configuration with the given key and language code exists.
- save() : void
- Saves a configuration item.
- saveBulk() : void
- Saves the configuration items.
- saveLanguageDependent() : void
- Saves language dependent configuration item.
- saveLanguageDependentBulk() : void
- Saves language dependent configuration items.
Methods
delete()
Deletes configurations.
public
delete(string ...$keys) : void
This function deletes all configuration items with the given keys. If any provided key not exists, the method will silently fail and continue.
Parameters
- $keys : string
Return values
void —find()
Searches for a configuration.
public
find(string $key) : Configuration
This method can return null, if no configuration was found with the provided key. Using ::has first ensures to find a valid, configuration.
Parameters
- $key : string
-
Configuration key.
Tags
Return values
Configuration —findLanguageDependent()
Searches for a language dependent configuration.
public
findLanguageDependent(string $key, string $languageCode) : LanguageDependentConfiguration|null
This method can return null, if no configuration was found with the provided key and language code. Using ::hasLanguageDependent first ensures to find a valid, configuration.
Parameters
- $key : string
- $languageCode : string
Tags
Return values
LanguageDependentConfiguration|null —has()
Checks if a configuration with the given key exists.
public
has(string $key) : bool
Parameters
- $key : string
-
Configuration key.
Return values
bool —hasLanguageDependent()
Checks if a configuration with the given key and language code exists.
public
hasLanguageDependent(string $key, string $languageCode) : bool
Parameters
- $key : string
- $languageCode : string
Return values
bool —save()
Saves a configuration item.
public
save(string $key, string|null $value) : void
This function either adds a configuration, if it not exists or updates an existing configuration.
Parameters
- $key : string
- $value : string|null
Return values
void —saveBulk()
Saves the configuration items.
public
saveBulk(array<string|int, mixed> $configurations) : void
This function either adds the configuration, if it not exists or updates an existing configuration. It is possible to provide multiple configurations.
Parameters
- $configurations : array<string|int, mixed>
Return values
void —saveLanguageDependent()
Saves language dependent configuration item.
public
saveLanguageDependent(string $key, string $languageCode, string|null $value) : void
This function either adds a configuration, if it not exists or updates an existing configuration.
Parameters
- $key : string
- $languageCode : string
- $value : string|null
Return values
void —saveLanguageDependentBulk()
Saves language dependent configuration items.
public
saveLanguageDependentBulk(array<string|int, mixed> $configurations) : void
This function either adds the configuration, if it not exists or updates an existing configuration. It is possible to provide multiple configurations.
The parameter $configurations must be a two-dimensional array and the inner one must contain the keys "key", "value", "languageCode".
Parameters
- $configurations : array<string|int, mixed>