RestService::getWorkflowTemplates: Bitrix method

      
<?php 
//  Bitrix\Bizproc\RestService :: getWorkflowTemplates()
//  /dist/bitrix/modules/bizproc/lib/restservice.php:705

    
public static function getWorkflowTemplates($params$n$server)
    {
        
self::checkAdminPermissions();
        
$params array_change_key_case($paramsCASE_UPPER);

        
$fields = array(
            
'ID' => 'ID',
            
'MODULE_ID' => 'MODULE_ID',
            
'ENTITY' => 'ENTITY',
            
'DOCUMENT_TYPE' => 'DOCUMENT_TYPE',
            
'AUTO_EXECUTE' => 'AUTO_EXECUTE',
            
'NAME' => 'NAME',
            
'DESCRIPTION' => 'DESCRIPTION',
            
'TEMPLATE' => 'TEMPLATE',
            
'PARAMETERS' => 'PARAMETERS',
            
'VARIABLES' => 'VARIABLES',
            
'CONSTANTS' => 'CONSTANTS',
            
'MODIFIED' => 'MODIFIED',
            
'IS_MODIFIED' => 'IS_MODIFIED',
            
'USER_ID' => 'USER_ID',
            
'SYSTEM_CODE' => 'SYSTEM_CODE',
        );

        
$select = static::getSelect($params['SELECT'], $fields, array('ID'));
        
$filter = static::getFilter($params['FILTER'], $fields, array('MODIFIED'));
        
$filter['<AUTO_EXECUTE'] = \CBPDocumentEventType::Automation;

        
$order = static::getOrder($params['ORDER'], $fields, array('ID' => 'ASC'));

        
$iterator WorkflowTemplateTable::getList(array(
            
'select' => $select,
            
'filter' => $filter,
            
'order' => $order,
            
'limit' => static::LIST_LIMIT,
            
'offset' => (int) $n,
            
'count_total' => true,
        ));

        
$countTotal $iterator->getCount();

        
$iterator = new \CBPWorkflowTemplateResult($iterator, \CBPWorkflowTemplateLoader::useGZipCompression());

        
$result = array();
        while (
$row $iterator->fetch())
        {
            if (isset(
$row['MODIFIED']))
                
$row['MODIFIED'] = \CRestUtil::convertDateTime($row['MODIFIED']);
            if (isset(
$row['STARTED']))
                
$row['STARTED'] = \CRestUtil::convertDateTime($row['STARTED']);
            if (isset(
$row['OWNED_UNTIL']))
                
$row['OWNED_UNTIL'] = \CRestUtil::convertDateTime($row['OWNED_UNTIL']);
            
$result[] = $row;
        }

        return static::
setNavData($result, ['count' => $countTotal'offset' => $n]);
    }