Documentation

Item

Description

ORM object for handling an item.

Contains set of getter/setters for system fields:

  • getStageId(): int
  • setStageId(int $stageId): void
  • getPreviousStageId(): int
  • setPreviousStageId(int $previousStageId): void
  • getCreatedBy(): int
  • setCreatedBy(int $userId): void
  • getUpdatedBy(): ?int
  • setUpdatedBy(int $userId): void
  • getMovedBy(): ?int
  • setMovedBy(int $userId): void
  • getCreatedTime(): Bitrix\Main\Type\DateTime
  • setCreatedTime(Bitrix\Main\Type\DateTime $dateTime): void
  • getUpdatedTime(): ?Bitrix\Main\Type\DateTime
  • setUpdatedTime(Bitrix\Main\Type\DateTime $dateTime): void
  • getMovedTime(): ?Bitrix\Main\Type\DateTime
  • setMovedTime(Bitrix\Main\Type\DateTime $dateTime): void

Chain of inheritance

Bitrix\Rpa\Model\Item extends Bitrix\Main\UserField\Internal\Item

Methods

Set of own class methods is provided below.

Method Description Available from version
public function getType(): Type Returns object Bitrix\Rpa\Model\Type - object for handling items process.
public function getStage(): ?Stage Returns object Bitrix\Rpa\Model\Stage - object for handling item stage.

Method cannot return a stage object, when it doesn't exist.

It must be taken into account that method returns an item stage that was updated in runtime.

public function getPreviousStage(): ?Stage Returns object Bitrix\Rpa\Model\Stage for previous item stage.

Operates similar to getStage()

public function getName(): string Returns string-item name.

When the process has a name field, the value is sourced from it. When there is no field available, the value is not sourced and the name is generated automatically

Title for a name field is generated using the template UF_RPA_ + process ID + NAME

public function isEmptyUserFieldValue($fieldName): bool Returns true, when field with code $fieldName does not have value.
public function getChangedUserFieldNames(): array Returns array of user field codes with updated values.
public function getUserIds(): array Returns array of unique user IDs from fields CREATED_BY, UPDATED_BY, MOVED_BY. When it has the same user, the result will be as follows:

$userId = $item->getCreatedBy(); // 10

$users = $item->getUserIds();
/*$users = [
    10 => 10,
];*/
public function isValueChanged(string $fieldName): bool Returns true, when field value with code $fieldName was updated.


© «Bitrix24», 2001-2024