Configuration
Table of Contents
Constants
- DEFAULT_PRESET_NAME = 'default'
- DEFAULT_PRESET_SETTING_NAME = 'default_configuration_preset'
- GENERAL_GROUP = 'general'
- NOTIFY_GROUP = 'notify'
- USER_PRESET_SORT = 1000000
Methods
- chooseExistingPreset() : void
- Sets a different preset for the user
- cleanAllCache() : void
- cleanUserCache() : void
- cleanUsersCache() : void
- createDefaultPreset() : int
- createSharedPreset() : int|null
- Creates a general preset for a department or a list of users by access codes with the selected priority, enters the settings into the database and sets the resulting group to users if the priority of their current group is not greater than this one.
- createUserPreset() : int
- Creates a personal preset of the user with the maximum priority, sets the settings in the database and exposes the resulting preset to the user
- deletePreset() : bool
- Deletes the selected preset
- getDefaultPresetId() : int
- getDefaultUserPreset() : array<string|int, mixed>
- getListAvailablePresets() : array<string|int, mixed>
- Gets a list of presets available to the user
- getPreset() : array{id: int, name: string, sort: int, settings: array}
- Gets a preset by its id
- getUserPreset() : array{notify: array, general: array}
- Gets the current preset of the user
- getUserPresetFromCache() : array<string|int, mixed>
- getUserPresetIds() : array{notify: int, general: int}|null
- restoreBindings() : int
- Restores the missing bindings between the user and his current preset settings in the b_im_option_user table
- setExistingPresetToUsers() : void
- Sets an existing preset to the users taking into account or not the priority of their current preset
- updateNameSharedPreset() : void
- Updates the name of the shared preset by its ID, also updates the date of change and who changed the preset
- updatePresetSettings() : void
- Updates the preset settings by its ID, also updates the date of change and who changed the preset
Constants
DEFAULT_PRESET_NAME
public
mixed
DEFAULT_PRESET_NAME
= 'default'
DEFAULT_PRESET_SETTING_NAME
public
mixed
DEFAULT_PRESET_SETTING_NAME
= 'default_configuration_preset'
GENERAL_GROUP
public
mixed
GENERAL_GROUP
= 'general'
NOTIFY_GROUP
public
mixed
NOTIFY_GROUP
= 'notify'
USER_PRESET_SORT
public
mixed
USER_PRESET_SORT
= 1000000
Methods
chooseExistingPreset()
Sets a different preset for the user
public
static chooseExistingPreset(int $presetId, int $userId) : void
Parameters
- $presetId : int
- $userId : int
Tags
cleanAllCache()
public
static cleanAllCache() : void
Tags
cleanUserCache()
public
static cleanUserCache(int $userId) : void
Parameters
- $userId : int
Tags
cleanUsersCache()
public
static cleanUsersCache(array<string|int, mixed> $usersId) : void
Parameters
- $usersId : array<string|int, mixed>
Tags
createDefaultPreset()
public
static createDefaultPreset() : int
Return values
intcreateSharedPreset()
Creates a general preset for a department or a list of users by access codes with the selected priority, enters the settings into the database and sets the resulting group to users if the priority of their current group is not greater than this one.
public
static createSharedPreset(array<string|int, mixed> $accessCodes, string $presetName, int $creatorId[, array<string|int, mixed> $settings = [] ][, int $sort = self::DEFAULT_SORT ][, bool $force = false ]) : int|null
If force is true, the priority of the current presets is not taken into account
Parameters
- $accessCodes : array<string|int, mixed>
- $presetName : string
- $creatorId : int
- $settings : array<string|int, mixed> = []
- $sort : int = self::DEFAULT_SORT
- $force : bool = false
Tags
Return values
int|nullcreateUserPreset()
Creates a personal preset of the user with the maximum priority, sets the settings in the database and exposes the resulting preset to the user
public
static createUserPreset(int $userId[, array<string|int, mixed> $settings = [] ]) : int
Parameters
- $userId : int
- $settings : array<string|int, mixed> = []
Tags
Return values
intdeletePreset()
Deletes the selected preset
public
static deletePreset(int $presetId) : bool
Parameters
- $presetId : int
Tags
Return values
boolgetDefaultPresetId()
public
static getDefaultPresetId() : int
Return values
intgetDefaultUserPreset()
public
static getDefaultUserPreset() : array<string|int, mixed>
Return values
array<string|int, mixed>getListAvailablePresets()
Gets a list of presets available to the user
public
static getListAvailablePresets(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Tags
Return values
array<string|int, mixed>getPreset()
Gets a preset by its id
public
static getPreset(int $id) : array{id: int, name: string, sort: int, settings: array}
Parameters
- $id : int
Tags
Return values
array{id: int, name: string, sort: int, settings: array}getUserPreset()
Gets the current preset of the user
public
static getUserPreset(int $userId) : array{notify: array, general: array}
Parameters
- $userId : int
Tags
Return values
array{notify: array, general: array}getUserPresetFromCache()
public
static getUserPresetFromCache(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Return values
array<string|int, mixed>getUserPresetIds()
public
static getUserPresetIds(int $userId) : array{notify: int, general: int}|null
Parameters
- $userId : int
Tags
Return values
array{notify: int, general: int}|nullrestoreBindings()
Restores the missing bindings between the user and his current preset settings in the b_im_option_user table
public
static restoreBindings(int $userId) : int
Parameters
- $userId : int
Return values
intsetExistingPresetToUsers()
Sets an existing preset to the users taking into account or not the priority of their current preset
public
static setExistingPresetToUsers(int $presetId, array<string|int, mixed> $userList[, bool $force = false ]) : void
Parameters
- $presetId : int
- $userList : array<string|int, mixed>
- $force : bool = false
Tags
updateNameSharedPreset()
Updates the name of the shared preset by its ID, also updates the date of change and who changed the preset
public
static updateNameSharedPreset(int $presetId, int $modifyId, string $newName) : void
Parameters
- $presetId : int
- $modifyId : int
- $newName : string
Tags
updatePresetSettings()
Updates the preset settings by its ID, also updates the date of change and who changed the preset
public
static updatePresetSettings(int $presetId, int $modifyId, array<string|int, mixed> $settings) : void
Parameters
- $presetId : int
- $modifyId : int
- $settings : array<string|int, mixed>