• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/automation/engine/template.php
  • Класс: Bitrix\Crm\Automation\Engine\Template
  • Вызов: Template::__construct
public function __construct(array $template = null)
{
	if (is_array($template))
	{
		$this->template = $template;
		if (count($template) === 2 && isset($template['ENTITY_TYPE_ID']) && isset($template['ENTITY_STATUS']))
		{
			$row = Entity\TemplateTable::getList(array(
				'filter' => array(
					'=ENTITY_TYPE_ID' => $template['ENTITY_TYPE_ID'],
					'=ENTITY_STATUS' => $template['ENTITY_STATUS']
				)
			))->fetch();
			if ($row)
			{
				$this->template = $row;
			}
		}
	}
	else
	{
		$this->template = array();
	}
}