TypeChecklistFacade extends CheckListFacade
Class CheckListFacade
Table of Contents
Constants
- ACTION_ADD = 0x1
- ACTION_MODIFY = 0x2
- ACTION_REMOVE = 0x3
- ACTION_REORDER = 0x5
- ACTION_TOGGLE = 0x4
- ACTIONS = ['COMMON' => [self::ACTION_ADD => 'ACTION_ADD', self::ACTION_REORDER => 'ACTION_REORDER'], 'ITEM' => [self::ACTION_MODIFY => 'ACTION_MODIFY', self::ACTION_REMOVE => 'ACTION_REMOVE', self::ACTION_TOGGLE => 'ACTION_TOGGLE']]
- MEMBER_ACCOMPLICE = 'A'
- MEMBER_AUDITOR = 'U'
- MOVING_POSITION_AFTER = 'after'
- MOVING_POSITION_BEFORE = 'before'
- TASK_ADD_CONTEXT = 'TASK_ADD'
Properties
- $commonAccessActions : mixed
- $currentAccessAction : mixed
- $entityIdName : mixed
- $itemAccessActions : mixed
- $oldItemsToMerge : mixed
- $userFieldsEntityIdName : mixed
Methods
- add() : Result
- addAttachmentByContent() : Result
- Attaches file represented by base64 content to checklist.
- addAttachmentsFromDisk() : Result
- Attaches file from bitrix24 disk to checklist.
- addMembers() : Result
- Adds members to checklist.
- checkAccess() : mixed
- checkFieldsForAdd() : Result
- Checks fields before adding checklist.
- checkFieldsForUpdate() : Result
- Checks fields before updating checklist.
- complete() : Result
- Completes checklist.
- completeAll() : Result
- Completes all checklists recursively starting from $checkList.
- delete() : Result|bool
- deleteByEntityId() : mixed
- Deletes all checklists of entity.
- deleteByEntityIdOnLowLevel() : mixed
- Deletes all checklists of entity.
- deleteComposite() : Result
- deleteLeaf() : Result
- doAddPostActions() : mixed
- Does some actions after adding checklist.
- doDeletePostActions() : mixed
- Does some actions after deleting checklists.
- doMergePostActions() : mixed
- Does some actions after merging checklists.
- doMergePreActions() : mixed
- Does some actions before merging checklists.
- doUpdatePostActions() : mixed
- Does some actions after updating checklist.
- fillActionsForItems() : mixed
- getArrayStructuredRoots() : array<string|int, mixed>
- Returns array of roots with subtrees as array structures.
- getByEntityId() : array<string|int, mixed>
- getCheckListDataController() : string
- Returns table class for checklist table.
- getCheckListMemberDataController() : string
- Returns table class for checklist member table.
- getCheckListTree() : string
- Returns class that extends abstract class CheckListTree
- getCheckListTreeDataController() : string
- Returns table class for checklist tree table.
- getFieldsForTable() : array<string|int, mixed>
- Returns array of fields suitable for table data adding or updating.
- getItemsForEntity() : array<string|int, mixed>
- Returns checklists with actions for entity if entity is accessible for reading.
- getList() : array<string|int, mixed>
- getObjectStructuredRoots() : array<string|int, mixed>
- Returns array of roots with subtrees as object structures.
- isActionAllowed() : bool
- Checks if action is allowed for user and entity.
- logError() : mixed
- Logs error message.
- merge() : Result
- Sets new checklists for entity by merging with old ones (runs through $newItems, adds completely new to entity, detects differences and changes inner data of changed checklists, deletes all old checklists it did not traverse through).
- moveItem() : Result
- Moves item before or after another item depending on position.
- removeAttachments() : Result
- Removes attachments from checklist.
- removeMembers() : Result
- Removes members from checklist.
- renew() : Result
- Renews checklist.
- update() : Result
- updateComposite() : Result
Constants
ACTION_ADD
public
mixed
ACTION_ADD
= 0x1
ACTION_MODIFY
public
mixed
ACTION_MODIFY
= 0x2
ACTION_REMOVE
public
mixed
ACTION_REMOVE
= 0x3
ACTION_REORDER
public
mixed
ACTION_REORDER
= 0x5
ACTION_TOGGLE
public
mixed
ACTION_TOGGLE
= 0x4
ACTIONS
public
mixed
ACTIONS
= ['COMMON' => [self::ACTION_ADD => 'ACTION_ADD', self::ACTION_REORDER => 'ACTION_REORDER'], 'ITEM' => [self::ACTION_MODIFY => 'ACTION_MODIFY', self::ACTION_REMOVE => 'ACTION_REMOVE', self::ACTION_TOGGLE => 'ACTION_TOGGLE']]
MEMBER_ACCOMPLICE
public
mixed
MEMBER_ACCOMPLICE
= 'A'
MEMBER_AUDITOR
public
mixed
MEMBER_AUDITOR
= 'U'
MOVING_POSITION_AFTER
public
mixed
MOVING_POSITION_AFTER
= 'after'
MOVING_POSITION_BEFORE
public
mixed
MOVING_POSITION_BEFORE
= 'before'
TASK_ADD_CONTEXT
public
mixed
TASK_ADD_CONTEXT
= 'TASK_ADD'
Properties
$commonAccessActions
public
static mixed
$commonAccessActions
= []
$currentAccessAction
public
static mixed
$currentAccessAction
$entityIdName
public
static mixed
$entityIdName
= 'ENTITY_ID'
$itemAccessActions
public
static mixed
$itemAccessActions
= []
$oldItemsToMerge
public
static mixed
$oldItemsToMerge
= []
$userFieldsEntityIdName
public
static mixed
$userFieldsEntityIdName
= ''
Methods
add()
public
static add(int $entityId, int $userId, array<string|int, mixed> $fields) : Result
Parameters
- $entityId : int
- $userId : int
- $fields : array<string|int, mixed>
Tags
Return values
ResultaddAttachmentByContent()
Attaches file represented by base64 content to checklist.
public
static addAttachmentByContent(int $entityId, int $userId, CheckList $checkList, array<string|int, mixed> $attachmentParameters) : Result
This function uploads file on bitrix24 disk before attaching.
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $attachmentParameters : array<string|int, mixed>
-
- consists of NAME => (string)$name and CONTENT => (base64)$content
Return values
ResultaddAttachmentsFromDisk()
Attaches file from bitrix24 disk to checklist.
public
static addAttachmentsFromDisk(int $entityId, int $userId, CheckList $checkList, array<string|int, mixed> $filesIds) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $filesIds : array<string|int, mixed>
Tags
Return values
ResultaddMembers()
Adds members to checklist.
public
static addMembers(int $entityId, int $userId, CheckList $checkList, mixed $members) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $members : mixed
Tags
Return values
ResultcheckAccess()
public
static checkAccess(mixed $entityId, mixed $userId, mixed $action[, mixed $params = null ]) : mixed
Parameters
- $entityId : mixed
- $userId : mixed
- $action : mixed
- $params : mixed = null
checkFieldsForAdd()
Checks fields before adding checklist.
public
static checkFieldsForAdd(array<string|int, mixed> $fields) : Result
Parameters
- $fields : array<string|int, mixed>
Return values
ResultcheckFieldsForUpdate()
Checks fields before updating checklist.
public
static checkFieldsForUpdate(array<string|int, mixed> $fields) : Result
Parameters
- $fields : array<string|int, mixed>
Return values
Resultcomplete()
Completes checklist.
public
static complete(int $entityId, int $userId, CheckList $checkList) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
ResultcompleteAll()
Completes all checklists recursively starting from $checkList.
public
static completeAll(int $entityId, int $userId, CheckList $checkList) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
Resultdelete()
public
static delete(int $entityId, int $userId, CheckList $checkList) : Result|bool
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
Result|booldeleteByEntityId()
Deletes all checklists of entity.
public
static deleteByEntityId(int $entityId, int $userId) : mixed
Works much slower than deleteByEntityIdOnLowLevel because of recursion, but checks rights and does post actions.
Parameters
- $entityId : int
- $userId : int
Tags
deleteByEntityIdOnLowLevel()
Deletes all checklists of entity.
public
static deleteByEntityIdOnLowLevel(int $entityId) : mixed
Works much faster than deleteByEntityId. This function doesn't check rights and doesn't do post actions.
Parameters
- $entityId : int
Tags
deleteComposite()
public
static deleteComposite(int $entityId, int $userId, CheckList $checkList) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
ResultdeleteLeaf()
public
static deleteLeaf(int $entityId, int $userId, CheckList $checkList) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
ResultdoAddPostActions()
Does some actions after adding checklist.
public
static doAddPostActions(int $entityId, int $userId, CheckList $checkList) : mixed
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
doDeletePostActions()
Does some actions after deleting checklists.
public
static doDeletePostActions(int $entityId, int $userId[, array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $entityId : int
- $userId : int
- $data : array<string|int, mixed> = []
doMergePostActions()
Does some actions after merging checklists.
public
static doMergePostActions(int $entityId, int $userId[, array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $entityId : int
- $userId : int
- $data : array<string|int, mixed> = []
doMergePreActions()
Does some actions before merging checklists.
public
static doMergePreActions(int $entityId, int $userId[, array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $entityId : int
- $userId : int
- $data : array<string|int, mixed> = []
doUpdatePostActions()
Does some actions after updating checklist.
public
static doUpdatePostActions(int $entityId, int $userId, CheckList $oldCheckList, CheckList $newCheckList) : mixed
Parameters
fillActionsForItems()
public
static fillActionsForItems(mixed $entityId, mixed $userId, mixed $items) : mixed
Parameters
- $entityId : mixed
- $userId : mixed
- $items : mixed
getArrayStructuredRoots()
Returns array of roots with subtrees as array structures.
public
static getArrayStructuredRoots(array<string|int, mixed> $sourceArray[, string $keyToParent = 'PARENT_ID' ]) : array<string|int, mixed>
Parameters
- $sourceArray : array<string|int, mixed>
- $keyToParent : string = 'PARENT_ID'
Return values
array<string|int, mixed>getByEntityId()
public
static getByEntityId(mixed $entityId) : array<string|int, mixed>
Parameters
- $entityId : mixed
Return values
array<string|int, mixed>getCheckListDataController()
Returns table class for checklist table.
public
static getCheckListDataController() : string
Return values
stringgetCheckListMemberDataController()
Returns table class for checklist member table.
public
static getCheckListMemberDataController() : string
Return values
stringgetCheckListTree()
Returns class that extends abstract class CheckListTree
public
static getCheckListTree() : string
Tags
Return values
stringgetCheckListTreeDataController()
Returns table class for checklist tree table.
public
static getCheckListTreeDataController() : string
Return values
stringgetFieldsForTable()
Returns array of fields suitable for table data adding or updating.
public
static getFieldsForTable(mixed $fields) : array<string|int, mixed>
Parameters
- $fields : mixed
Return values
array<string|int, mixed>getItemsForEntity()
Returns checklists with actions for entity if entity is accessible for reading.
public
static getItemsForEntity(mixed $entityId, mixed $userId) : array<string|int, mixed>
Parameters
- $entityId : mixed
- $userId : mixed
Return values
array<string|int, mixed>getList()
public
static getList([array<string|int, mixed> $select = [] ][, array<string|int, mixed> $filter = [] ][, array<string|int, mixed> $order = [] ]) : array<string|int, mixed>
Parameters
- $select : array<string|int, mixed> = []
- $filter : array<string|int, mixed> = []
- $order : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>getObjectStructuredRoots()
Returns array of roots with subtrees as object structures.
public
static getObjectStructuredRoots(array<string|int, mixed> $items, int $entityId, int $userId[, string $keyToParent = 'PARENT_ID' ]) : array<string|int, mixed>
Parameters
- $items : array<string|int, mixed>
- $entityId : int
- $userId : int
- $keyToParent : string = 'PARENT_ID'
Tags
Return values
array<string|int, mixed>isActionAllowed()
Checks if action is allowed for user and entity.
public
static isActionAllowed(int $entityId, CheckList|null $checkList, int $userId, mixed $actionId) : bool
Parameters
- $entityId : int
- $checkList : CheckList|null
- $userId : int
- $actionId : mixed
Return values
boollogError()
Logs error message.
public
static logError(string $message) : mixed
Parameters
- $message : string
merge()
Sets new checklists for entity by merging with old ones (runs through $newItems, adds completely new to entity, detects differences and changes inner data of changed checklists, deletes all old checklists it did not traverse through).
public
static merge(int $entityId, int $userId, array<string|int, mixed> $newItems[, array<string|int, mixed> $parameters = [] ]) : Result
Parameters
- $entityId : int
- $userId : int
- $newItems : array<string|int, mixed>
- $parameters : array<string|int, mixed> = []
Tags
Return values
ResultmoveItem()
Moves item before or after another item depending on position.
public
static moveItem(int $entityId, int $userId, CheckList $itemToMove, int $relatedItemId[, string $position = self::MOVING_POSITION_AFTER ]) : Result
Parameters
- $entityId : int
- $userId : int
- $itemToMove : CheckList
- $relatedItemId : int
- $position : string = self::MOVING_POSITION_AFTER
Tags
Return values
ResultremoveAttachments()
Removes attachments from checklist.
public
static removeAttachments(int $entityId, int $userId, CheckList $checkList, array<string|int, mixed> $attachmentsIds) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $attachmentsIds : array<string|int, mixed>
Tags
Return values
ResultremoveMembers()
Removes members from checklist.
public
static removeMembers(int $entityId, int $userId, CheckList $checkList, mixed $membersIds) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $membersIds : mixed
Tags
Return values
Resultrenew()
Renews checklist.
public
static renew(int $entityId, int $userId, CheckList $checkList) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
Tags
Return values
Resultupdate()
public
static update(int $entityId, int $userId, CheckList $checkList, mixed $fields) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $fields : mixed
Tags
Return values
ResultupdateComposite()
public
static updateComposite(int $entityId, int $userId, CheckList $checkList, array<string|int, mixed> $fields) : Result
Parameters
- $entityId : int
- $userId : int
- $checkList : CheckList
- $fields : array<string|int, mixed>