CBPRuntime::checkActivityFilterRules

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPRuntime
  4. checkActivityFilterRules
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/runtime.php
  • Класс: CBPRuntime
  • Вызов: CBPRuntime::checkActivityFilterRules
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;
}

Добавить комментарий