CBPWorkflowTemplateLoader :: GetStatesOfTemplate: Bitrix method

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

    
public static function GetStatesOfTemplate($arWorkflowTemplate)
    {
        if (!
is_array($arWorkflowTemplate))
            throw new 
CBPArgumentTypeException("arWorkflowTemplate""array");

        if (!
is_array($arWorkflowTemplate[0]))
            throw new 
CBPArgumentTypeException("arWorkflowTemplate");

        
$arStates = array();
        foreach (
$arWorkflowTemplate[0]["Children"] as $state)
            
$arStates[$state["Name"]] = (strlen($state["Properties"]["Title"]) > $state["Properties"]["Title"] : $state["Name"]);

        return 
$arStates;
    }