GambioOmnibusPolicyTextPhrasesStorage
extends ConfigurationStorage
in package
Class GambioOmnibusPolicyTextPhrasesStorage
Table of Contents
- STORAGE_NAMESPACE = 'modules/gambio/omnibus_policy/reviews/phrases'
- Configuration storage namespace
- $textPhrasesKeys : array<string|int, mixed>
- Language specific phrase storage
- __construct() : mixed
- Constructor
- delete() : $this
- Removes a phrase value
- deleteAll() : $this
- Removes a phrase value
- get() : string
- Return a phrase value
- getAll() : array<string|int, mixed>
- Return all phrase key/value pairs
- set() : $this
- Set a phrase value
- setAll() : $this
- Set multiple text phrases at one time for specific key Note: input data should one of two formats 1) ['text_phrase_key_language_code_1' => 'text_value_1','text_phrase_key_language_code_2' => 'text_value_2'] 2) ['text_phrase_key' => ['language_code' => 'text_value']]
- isAllowed() : bool
Constants
STORAGE_NAMESPACE
Configuration storage namespace
public
mixed
STORAGE_NAMESPACE
= 'modules/gambio/omnibus_policy/reviews/phrases'
Properties
$textPhrasesKeys
Language specific phrase storage
private
array<string|int, mixed>
$textPhrasesKeys
= []
Methods
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —delete()
Removes a phrase value
public
delete(string $key) : $this
Parameters
- $key : string
-
Configuration key
Tags
Return values
$this —Same instance
deleteAll()
Removes a phrase value
public
deleteAll() : $this
Tags
Return values
$this —Same instance
get()
Return a phrase value
public
get(string $key) : string
Parameters
- $key : string
-
phrase key
Tags
Return values
string —phrase value
getAll()
Return all phrase key/value pairs
public
getAll() : array<string|int, mixed>
Return values
array<string|int, mixed> —Key/Value pairs
set()
Set a phrase value
public
set(string $key, string $value) : $this
Parameters
- $key : string
-
Configuration key
- $value : string
-
Configuration value
Tags
Return values
$this —Same instance
setAll()
Set multiple text phrases at one time for specific key Note: input data should one of two formats 1) ['text_phrase_key_language_code_1' => 'text_value_1','text_phrase_key_language_code_2' => 'text_value_2'] 2) ['text_phrase_key' => ['language_code' => 'text_value']]
public
setAll([array<string|int, mixed> $data = [] ]) : $this
Parameters
- $data : array<string|int, mixed> = []
Return values
$this —isAllowed()
private
isAllowed(string &$key[, bool $isOptional = false ]) : bool
Parameters
- $key : string
- $isOptional : bool = false
-
when false, return will be surprised and replaced with exception