Documentation

Entity

Kanban provides a universal entity view. The same component crm.kanban is responsible for all types of views.

Staring from CRM module version 20.5.500 the majority of entity-dependant elements have been moved to a dedicated namespace \Bitrix\Crm\Kanban\Entity.

Depending on the entity type, specific instance is retrieved using the method getInstance().

This method gets an instance via ServiceLocator.

Accordingly, using the method ServiceLocator::addInstance() allows redefining the employed class to change its behaviour.

Methods

Method Description Available from version
getTypeName(): stringReturns string identifier for entity type (for example, DEAL for deals).
getTypeId(): intReturns string identifier for entity type (for example, 2 for deals).
getStatusEntityId(): stringReturns entity ID for handling stages (table b_crm_status).
getItemsSelectPreset(): arrayReturns list of default fields for selecting from table with entity elements.
isCategoriesSupported(): boolReturns true when entity type supports handling of pipelines.
isRestPlacementSupported(): boolReturns true when entity type supports app embedding into Kanban.
isCustomPriceFieldsSupported(): boolReturns true when entity type supports custom field for money amounts.
isInlineEditorSupported(): boolReturns true when entity type supports quick element creation in kanban.
isEntitiesLinksInFilterSupported(): boolReturns true when entity type supports fields with bindings to other entities in filter.
isOverdueFilterSupported(): boolReturns true when entity type has checkbox "overdue" in filter.
isActivityCountersFilterSupported(): boolReturns true when elements of this entity type can be filtered by counters.
isRecurringSupported(): boolReturns true when entity type supports recurring feature.
hasOwnMultiFields(): boolReturns true when entity type has its own custom multi fields.
isActivityCountersSupported(): boolReturns true when entity type has counters.
isExclusionSupported(): boolReturns true, when entity type supports adding to exception list.
isNeedToRunAutomation(): boolReturns true when system must run automation after updating the entity element.
getCloseDateFieldName(): stringReturns the field, containing date when entity element was closed.
getEditorConfigId(): stringReturns string ID for settings of element universal editor.
hasOpenedField(): boolReturns true when element of this entity type has the field "Available for all".
removeUserAdditionalSelectFields(): boolClears view detail settings for current user.
resetAdditionalSelectFields(bool $canEditCommon): boolClears view detail settings for all users.
ParameterDescription
$canEditCommonIndicates edit access permissions for general settings.
saveAdditionalFields(array $fields, string $type, bool $canEditCommon): boolSaves view detail settings or edit quick form.
ParameterDescription
$fieldsSets of fields.
$type - settings type. Can be view or edit.
$canEditCommonIndicates user access permissions for general settings edit.
getAdditionalSelectFields(): boolReturns set of additional fields for retrieving entity elements from the database.
getAdditionalEditFields(): arrayReturns additional fields for quick edit form.
getCustomPriceFieldName(): ?stringReturns additional field for storage of price amounts if specified.
getStageFieldName(): stringReturns field name storing stage ID for an element.
getInlineEditorParameters(): arrayReturns array with editor settings for quick creation form.
getUserFields(): arrayReturns descriptions for element custom fields of entity elements.
getRequiredFieldsByStages(array $stages): arrayReturns set of required fields with key - field name and value - array with stage IDs, where this field is required.
ParameterDescription
$stagesArray with stage description.
fillStageTotalSums(array $filter, array $runtime, array &$stages): void
ParameterDescription
$filterKanban filter.
$runtimeRuntime-field for kanban filter.
$stagesStage description.

Method completes final prices for stages.

  • count - number of elements
  • total - final price as a number
  • total_format - formatted string with final total price
getItems(array $parameters): \CDBResultReturns result for element retrieval.
ParameterDescription
$parametersSets of parameters for a query. Similar to the array for the method DataManager::getList().
prepareItemCommonFields(array $item): arrayPrepares element field names to a "general" view.
ParameterDescription
$itemArray with element fields.
deleteItems(array $ids, bool $isIgnore = false, \CCrmPerms $permissions = null): voidDeletes elements with identifiers $ids.
ParameterDescription
$idsArray with element IDs.
$isIgnoreAdd to exceptions list.
$permissionsAccess permissions.
getItem(int $id): ?arrayReturns element description by its $id.
ParameterDescription
$idElement ID.
setItemsAssigned(array $ids, int $assignedId, \CCrmPerms $permissions): ResultAssigns new responsible user $assignedId for elements with ID - $ids.
ParameterDescription
$idsArray with element IDs.
$assignedIdResponsible user ID.
$permissionsAccess permissions.
updateItemsOpened(array $ids, bool $isOpened): ResultChanges flag from "Available for all" for elements with ID $ids to $isOpened.
ParameterDescription
$idsArray with element IDs.
$isOpenedFlag value "Available for all".
updateItemStage(int $id, string $stageId, array $newStateParams, array $stages): ResultReplaces element with ID $id to a stage with ID $stageId.
ParameterDescription
$idElement identifier.
$stageIdNew stage identifier.
$newStateParams>Array with additional moved for moving.
$stagesStage description.


© «Bitrix24», 2001-2024
Up