RestService :: getFilter: Bitrix method

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

    
private static function getFilter($rules$fields, array $datetimeFieldsList = array())
    {
        
$filter = array();
        if (!empty(
$rules) && is_array($rules))
        {
            foreach (
$rules as $key => $value)
            {
                if (
preg_match('/^([^a-zA-Z]*)(.*)/'$key$matches))
                {
                    
$operation $matches[1];
                    
$field $matches[2];

                    if (
in_array($operation, static::$allowedOperationstrue) && isset($fields[$field]))
                    {
                        if (
in_array($field$datetimeFieldsList))
                            
$value = \CRestUtil::unConvertDateTime($value);

                        
$filter[$operation.$fields[$field]] = $value;
                    }
                }
            }
        }

        return 
$filter;
    }