CBPWorkflowTemplateLoader :: GetDocumentTypeStates: Bitrix method

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

    
public static function GetDocumentTypeStates($documentType$autoExecute = -1$stateName "")
    {
        
$arFilter = array("DOCUMENT_TYPE" => $documentType);
        
$autoExecute intval($autoExecute);

        
$cacheKey implode('@'$documentType).'@'.$autoExecute;

        if (!isset(static::
$typesStates[$cacheKey]))
        {
            
$result = array();
            if (
$autoExecute >= 0)
                
$arFilter["AUTO_EXECUTE"] = $autoExecute;
            
$arFilter["ACTIVE"] = "Y";

            
$dbTemplatesList self::GetList(
                array(),
                
$arFilter,
                
false,
                
false,
                array(
'ID''NAME''DESCRIPTION''TEMPLATE''PARAMETERS''VARIABLES''CONSTANTS')
            );
            while (
$arTemplatesListItem $dbTemplatesList->Fetch())
                
$result[$arTemplatesListItem["ID"]] = self::ParseDocumentTypeStates($arTemplatesListItem);

            static::
$typesStates[$cacheKey] = $result;
        }
        return static::
$typesStates[$cacheKey];
    }