CacheMenuFactory
in package
Class MenuFactory
Tags
Table of Contents
- $languageId : int
- $textManager : TextManager
- __construct() : mixed
- MenuFactory constructor.
- createConditions() : Conditions|null
- Creates a condition if possible.
- createMenuGroup() : MenuGroup
- Creates a menu group.
- createMenuItem() : MenuItem
- Creates a menu item.
- createCondition() : Condition|null
- Tries to create a condition object from the given data.
- createMultipleConditions() : Conditions|null
- Creates a conditions object from the given data.
- createSingleCondition() : Conditions|null
- Creates a conditions object from the given data.
- isNumericArray() : bool
- Checks if given array is numeric.
- translate() : string|null
- Translates the language key.
Properties
$languageId
private
int
$languageId
$textManager
private
TextManager
$textManager
Methods
__construct()
MenuFactory constructor.
public
__construct(TextManager $textManager, UserPreferences $userPreferences) : mixed
Parameters
- $textManager : TextManager
- $userPreferences : UserPreferences
Return values
mixed —createConditions()
Creates a condition if possible.
public
createConditions(array<string|int, mixed> $data) : Conditions|null
This function ties to create a new condition model from the given data. If anything goes wrong, just null will be returned. This can be the case too, if the "if" key not exists in the data set, which means that no filter should be applied.
Parameters
- $data : array<string|int, mixed>
Return values
Conditions|null —createMenuGroup()
Creates a menu group.
public
createMenuGroup(array<string|int, mixed> $data, Conditions|null $conditions) : MenuGroup
This function creates a menu group model from the given data. In case of bad formed $data, an exception is thrown.
Parameters
- $data : array<string|int, mixed>
- $conditions : Conditions|null
Tags
Return values
MenuGroup —createMenuItem()
Creates a menu item.
public
createMenuItem(array<string|int, mixed> $data[, Conditions|null $conditions = null ]) : MenuItem
This function creates a menu item from the given data. In case of bad formed $data, an exception is thrown.
Parameters
- $data : array<string|int, mixed>
- $conditions : Conditions|null = null
Tags
Return values
MenuItem —createCondition()
Tries to create a condition object from the given data.
private
createCondition(array<string|int, mixed> $data) : Condition|null
Parameters
- $data : array<string|int, mixed>
Return values
Condition|null —createMultipleConditions()
Creates a conditions object from the given data.
private
createMultipleConditions(array<string|int, mixed> $conditionData) : Conditions|null
It is expected that the data contains information about multiple conditions.
Parameters
- $conditionData : array<string|int, mixed>
Return values
Conditions|null —createSingleCondition()
Creates a conditions object from the given data.
private
createSingleCondition(array<string|int, mixed> $conditionData) : Conditions|null
It is expected that the data contains information for exactly one condition.
Parameters
- $conditionData : array<string|int, mixed>
Return values
Conditions|null —isNumericArray()
Checks if given array is numeric.
private
isNumericArray(array<string|int, mixed> $array) : bool
Parameters
- $array : array<string|int, mixed>
Return values
bool —translate()
Translates the language key.
private
translate(string|null $langKey) : string|null
Parameters
- $langKey : string|null