• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/timeline/activitycontroller.php
  • Класс: Bitrix\Crm\Timeline\ActivityController
  • Вызов: ActivityController::createItemByScheduledData
protected function createItemByScheduledData(Context $context, array $scheduledData):
	?\Bitrix\Crm\Service\Timeline\Item
{
	if (empty($scheduledData))
	{
		return null;
	}

	$activityId = (int)$scheduledData['ID'];
	if (!array_key_exists('IS_INCOMING_CHANNEL', $scheduledData))
	{
		$scheduledData['IS_INCOMING_CHANNEL'] = \Bitrix\Crm\Activity\IncomingChannel::getInstance()->isIncomingChannel($activityId) ? 'Y' : 'N';
	}
	if (!array_key_exists('LIGHT_COUNTER_AT', $scheduledData))
	{
		$scheduledData['LIGHT_COUNTER_AT'] = ServiceLocator::getInstance()->get('crm.activity.actcounterlighttimerepo')->queryLightTimeByActivityId($activityId);
	}

	return Container::getInstance()->getTimelineScheduledItemFactory()::createItem(
		$context,
		$scheduledData
	);
}