• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replicator/template/service/templatehistoryservice.php
  • Класс: BitrixTasksReplicatorTemplateServiceTemplateHistoryService
  • Вызов: TemplateHistoryService::write
public function write(string $message, Result $operationResult, int $taskId = 0): Result
{
	$result = new Result();

	$record = new SystemLogObject();
	$record
		->setEntityType(SystemLogTable::ENTITY_TYPE_TEMPLATE)
		->setType(SystemLogTable::TYPE_MESSAGE)
		->setCreatedDate(new DateTime())
		->setEntityId($this->repository->getTemplate()->getId())
		->setMessage($message)
		->setParamA($taskId)
	;

	if (!$operationResult->isSuccess())
	{
		$record->setError($this->makeError($operationResult));
		$record->setType(SystemLogTable::TYPE_ERROR);
	}

	$record->save();

	return $result;
}