CBPRuntime :: checkActivityFilterRules: Bitrix method

      
<?php 
//  CBPRuntime :: checkActivityFilterRules()
//  /dist/bitrix/modules/bizproc/classes/general/runtime.php:771

    
private function checkActivityFilterRules($rules$documentType$distrName)
    {
        if (!
is_array($rules) || CBPHelper::IsAssociativeArray($rules))
            
$rules = array($rules);

        foreach (
$rules as $rule)
        {
            
$result false;
            if (
is_array($rule))
            {
                if (!
$documentType)
                    
$result true;
                else
                {
                    foreach (
$documentType as $key => $value)
                    {
                        if (!isset(
$rule[$key]))
                            break;
                        
$result $rule[$key] == $value;
                        if (!
$result)
                            break;
                    }
                }
            }
            else
            {
                
$result = (string)$rule == $distrName;
            }
            if (
$result)
                return 
true;
        }
        return 
false;
    }