CBP::checkActivityFilterRules

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

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