Bitrix API

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'

Methods

chooseExistingPreset()

Sets a different preset for the user

public static chooseExistingPreset(int $presetId, int $userId) : void
Parameters
$presetId : int
$userId : int
Tags
throws
Exception

cleanUsersCache()

public static cleanUsersCache(array<string|int, mixed> $usersId) : void
Parameters
$usersId : array<string|int, mixed>
Tags
see
CacheManager

createDefaultPreset()

public static createDefaultPreset() : int
Return values
int

createSharedPreset()

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
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
int|null

createUserPreset()

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
throws
ObjectPropertyException
throws
SystemException
throws
ArgumentException
throws
Exception
Return values
int

deletePreset()

Deletes the selected preset

public static deletePreset(int $presetId) : bool
Parameters
$presetId : int
Tags
throws
SystemException
Return values
bool

getDefaultPresetId()

public static getDefaultPresetId() : int
Return values
int

getDefaultUserPreset()

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
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
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
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
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
see
UserConfiguration
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
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
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array{notify: int, general: int}|null

restoreBindings()

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
int

setExistingPresetToUsers()

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
throws
ObjectPropertyException
throws
ArgumentException
throws
SystemException

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
throws
Exception

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>
Tags
throws
SystemException
throws
ArgumentException
throws
Exception

        
On this page

Search results