CBPWorkflowTemplateLoader :: SearchTemplatesByDocumentType: Bitrix method

      
<?php 
//  CBPWorkflowTemplateLoader :: SearchTemplatesByDocumentType()
//  /dist/bitrix/modules/bizproc/classes/general/workflowtemplateloader.php:696

    
public static function SearchTemplatesByDocumentType($documentType$autoExecute = -1)
    {
        
$result = array();

        
$arFilter = array("DOCUMENT_TYPE" => $documentType);
        
$autoExecute intval($autoExecute);
        if (
$autoExecute >= 0)
            
$arFilter["AUTO_EXECUTE"] = $autoExecute;

        
$dbTemplatesList self::GetList(
            array(),
            
$arFilter,
            
false,
            
false,
            array(
"ID""NAME""DESCRIPTION""AUTO_EXECUTE")
        );
        while (
$arTemplatesListItem $dbTemplatesList->Fetch())
        {
            
$result[] = array(
                
"ID" => $arTemplatesListItem["ID"],
                
"NAME" => $arTemplatesListItem["NAME"],
                
"DESCRIPTION" => $arTemplatesListItem["DESCRIPTION"],
                
"AUTO_EXECUTE" => $arTemplatesListItem["AUTO_EXECUTE"],
            );
        }

        return 
$result;
    }