Task::getCompletedActivityEntryId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Task
  4. getCompletedActivityEntryId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/provider/tasks/task.php
  • Класс: Bitrix\Crm\Activity\Provider\Tasks\Task
  • Вызов: Task::getCompletedActivityEntryId
public function getCompletedActivityEntryId(int $activityId, int $taskId): int
{
	$completedActivityQuery = TimelineTable::query();
	$completedActivityQuery
		->setSelect(['ID'])
		->where('SOURCE_ID', $taskId)
		->where('ASSOCIATED_ENTITY_ID', $activityId)
		->where('ASSOCIATED_ENTITY_CLASS_NAME', self::getId())
		->where('TYPE_ID', TimelineType::ACTIVITY)
		->where('TYPE_CATEGORY_ID', \CCrmActivityType::Provider)
		->where('ASSOCIATED_ENTITY_TYPE_ID', \CCrmActivityType::Provider)
		->setLimit(1)
	;

	$completedActivity = $completedActivityQuery->exec()->fetchObject();
	if (is_null($completedActivity))
	{
		return 0;
	}

	return $completedActivity->getId();
}

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