Template::__construct: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Automation\Engine\Template :: __construct()
//  /dist/bitrix/modules/bizproc/lib/automation/engine/template.php:41

    /**
     * Template constructor.
     * @param array $documentType
     * @param null $documentStatus
     * @throws ArgumentException
     * @throws \Bitrix\Main\ObjectPropertyException
     * @throws \Bitrix\Main\SystemException
     */
    
public function __construct(array $documentType$documentStatus null)
    {
        
$this->template = array(
            
'ID' => 0,
            
'MODULE_ID' => $documentType[0],
            
'ENTITY' => $documentType[1],
            
'DOCUMENT_TYPE' => $documentType[2],
            
'DOCUMENT_STATUS' => $documentStatus,
            
'AUTO_EXECUTE' => $this->autoExecuteType,
            
'TEMPLATE' => [],
            
'PARAMETERS' => [],
            
'CONSTANTS' => [],
        );

        if (
$documentStatus)
        {
            
$row WorkflowTemplateTable::getList([
                
'filter' => [
                    
'=MODULE_ID' => $documentType[0],
                    
'=ENTITY' => $documentType[1],
                    
'=DOCUMENT_TYPE' => $documentType[2],
                    
'=DOCUMENT_STATUS' => $documentStatus,
                    
//'=AUTO_EXECUTE' => $this->autoExecuteType
                
]
            ])->
fetch();
            if (
$row)
            {
                
$this->template $row;
                
$this->autoExecuteType = (int) $this->template['AUTO_EXECUTE'];
            }
        }
    }