• Модуль: documentgenerator
  • Путь к файлу: ~/bitrix/modules/documentgenerator/lib/document.php
  • Класс: BitrixDocumentGeneratorDocument
  • Вызов: Document::resolveValue
protected function resolveValue($value)
{
	if(is_string($value))
	{
		$valueNameParts = explode('.', $value);
		if(count($valueNameParts) > 1 && $valueNameParts[0] === static::THIS_PLACEHOLDER)
		{
			array_shift($valueNameParts);
			$valueName = implode('.', $valueNameParts);
			$value = $this->getValue($valueName);
			// next code is needed when we have a placeholder that points to some item value from ArrayDataProvider.
			if($value === $valueName)
			{
				$value = static::THIS_PLACEHOLDER.'.'.$valueName;
			}
		}
	}
	elseif(is_callable($value))
	{
		if (is_array($value) && $value[0] === $this)
		{
			$value = $value();
		}
		else
		{
			$value = null;
		}
	}

	return $value;
}