Description and methods

ORM class object for handling table of user item sorting in kanban.

Chain of inheritance

Descendant of class Bitrix\Main\ORM\Data\DataManager.


Method Description Available from version
public static function setSortForItem(Item $item, int $userId, int $sort): ORM\Data\Result When item has a specific sorting, it is updated. When there is no record, it is created. Returns ORM\Data\Result.
public static function removeForItem(int $typeId, int $itemId): Result Deletes all table records associated with $itemId of process $typeId. Returns object Bitrix\Main\Result.
public static function removeByTypeId(int $typeId): Result Deletes all table records, associated with process $typeId. Returns object Bitrix\Main\Result.
public static function getSort(int $userId, Type $type, int $stageId, int $previousItemId = null, bool $isResort = true): int Returns sort index for item, considering its stage status.

It re-sorts items within at a specific stage, when encountering a conflict.

Use with caution, because queries are executed within.

public static function fillItemsSortInStageBeforeItem(int $userId, Item $beforeItem): void Fills in sorting index for items before $beforeItem for user $userId.
public static function getMaxSort(int $userId, Stage $stage): int Returns maximum sort index for user $userId at the stage $stage.
public static function getItemReferenceField(Type $type): Reference Returns object Bitrix\Main\ORM\Fields\Relations\Reference for binding with specific table of process items $typeId.

Table fields

Field Description Type Required
ID IdentifierInt Yes
USER_ID User ID.Int Yes
TYPE_ID Process ID.Int Yes
ITEM_ID Item ID.Int Yes
SORT Sort ID.Int Yes

© «Bitrix24», 2001-2023