• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/templates/selector.php
  • Класс: BitrixSenderTemplatesSelector
  • Вызов: Selector::checkTemplate
private function checkTemplate($template)
{
	if (count($template['FIELDS']) === 0)
	{
		return false;
	}

	if ($this->messageCode)
	{
		$messageCodes = $template['MESSAGE_CODE'];
		if (!is_array($messageCodes))
		{
			$messageCodes = array($messageCodes);
		}
		if (!in_array($this->messageCode, $messageCodes))
		{
			return false;
		}
	}

	if ($this->version && $template['VERSION'] < $this->version)
	{
		return false;
	}

	if (!$this->includeTriggers && $template['IS_TRIGGER'])
	{
		return false;
	}

	if (!in_array($template['TYPE'], Type::getCodes()))
	{
		return false;
	}

	if ($this->id && $this->id != $template['ID'])
	{
		return false;
	}

	return true;
}