TaskItem::initByRow

  1. Bitrix24 API (v. 23.675.0)
  2. im
  3. TaskItem
  4. initByRow
  • Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/Task/TaskItem.php
  • Класс: Bitrix\Im\V2\Entity\Task\TaskItem
  • Вызов: TaskItem::initByRow
static function initByRow(array $row): self
{
	$taskEntity = new static();

	$membersIds = array_merge(
		[(int)$row['CREATED_BY']],
		[(int)$row['RESPONSIBLE_ID']],
		array_map(static fn ($id) => (int)$id, $row['AUDITORS'] ?? []),
		array_map(static fn ($id) => (int)$id, $row['ACCOMPLICES'] ?? [])
	);
	$uniqueMembersIds = array_unique($membersIds);

	$taskEntity
		->setTaskId((int)$row['ID'])
		->setTitle($row['TITLE'])
		->setDeadline(isset($row['DEADLINE']) ? new DateTime($row['DEADLINE']) : null)
		->setStatus((int)$row['REAL_STATUS'])
		->setCreatorId((int)$row['CREATED_BY'])
		->setResponsibleId((int)$row['RESPONSIBLE_ID'])
		->setMembersIds(array_values($uniqueMembersIds))
	;

	return $taskEntity;
}

Добавить комментарий