• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitymanagefacility.php
  • Класс: Bitrix\Crm\EntityManageFacility
  • Вызов: EntityManageFacility::traceEntity
protected function traceEntity($entityTypeId, $entityId)
{
	if ($this->direction !== self::DIRECTION_INCOMING)
	{
		return $this;
	}

	if (!$entityTypeId || !$entityId)
	{
		return $this;
	}

	if (!$this->trace && !$this->traceId)
	{
		return $this;
	}

	if (!$this->traceId)
	{
		$this->traceId = $this->trace->save();
	}

	if (!$this->traceId)
	{
		return $this;
	}

	Tracking\Trace::appendEntity($this->traceId, $entityTypeId, $entityId);
	return $this;
}