• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/subtaskitemabstract.php
  • Класс: CTaskSubItemAbstract
  • Вызов: CTaskSubItemAbstract::getData
public function getData($bEscape = true)
{
	if ($this->cachedData === null)
	{
		try
		{
			// Ensure that we have read access for task
			$this->oTaskItem->getData();
			$this->cachedData = static::fetchDataFromDb($this->taskId, $this->itemId);
		}
		catch (Exception $e)
		{
			throw new TasksException('Check listitem not found or not accessible', TasksException::TE_ITEM_NOT_FOUND_OR_NOT_ACCESSIBLE);
		}
	}

	if ($bEscape)
	{
		// Prepare escaped data on-demand
		if ($this->cachedEscapedData === null)
		{
			foreach ($this->cachedData as $field => $value)
			{
				$this->cachedEscapedData['~' . $field] = $value;

				if (is_numeric($value) || ( ! is_string($value) ) )
					$this->cachedEscapedData[$field] = $value;
				else
					$this->cachedEscapedData[$field] = htmlspecialcharsex($value);
			}
		}

		return ($this->cachedEscapedData);
	}
	else
		return ($this->cachedData);
}