• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/item/systemlog.php
  • Класс: BitrixTasksItemSystemLog
  • Вызов: SystemLog::prepareData
public function prepareData($result)
{
	$id = $this->getId();
	if(!$id)
	{
		$now = new BitrixMainTypeDateTime();

		if(!$this->isFieldModified('CREATED_DATE')) // created date was not set manually
		{
			$this['CREATED_DATE'] = $now;
		}
		if(!$this->isFieldModified('TYPE')) // set type from error collection contents
		{
			$this['TYPE'] = static::TYPE_NOTICE;
			if(!$this['ERROR']->isEmpty())
			{
				$this['TYPE'] = $this['ERROR']->filter(array('TYPE' => Error::TYPE_FATAL))->isEmpty() ? static::TYPE_WARNING : static::TYPE_ERROR;
			}
		}
	}

	return $result;
}