• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/workflowtemplateloader.php
  • Класс: CBPWorkflowTemplateLoader
  • Вызов: CBPWorkflowTemplateLoader::getTemplateConstants
static function getTemplateConstants($workflowTemplateId)
{
	$workflowTemplateId = (int) $workflowTemplateId;
	if ($workflowTemplateId <= 0)
		throw new CBPArgumentOutOfRangeException("workflowTemplateId", $workflowTemplateId);

	if (!isset(self::$workflowConstants[$workflowTemplateId]))
	{
		$cache = BitrixMainApplication::getInstance()->getManagedCache();
		$cacheTag = self::CONSTANTS_CACHE_TAG_PREFIX.$workflowTemplateId;
		if ($cache->read(3600*24*7, $cacheTag))
		{
			self::$workflowConstants[$workflowTemplateId] = (array) $cache->get($cacheTag);
		}
		else
		{
			$iterator = self::GetList(
				array(),
				array('ID' => $workflowTemplateId),
				false,
				false,
				array('CONSTANTS')
			);
			if ($row = $iterator->fetch())
			{
				self::$workflowConstants[$workflowTemplateId] = (array) $row['CONSTANTS'];
				$cache->set($cacheTag, self::$workflowConstants[$workflowTemplateId]);
			}
			else
				self::$workflowConstants[$workflowTemplateId] = array();

		}
	}

	return self::$workflowConstants[$workflowTemplateId];
}