• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/util/error.php
  • Класс: BitrixTasksUtilError
  • Вызов: Error::matchFilter
public function matchFilter($filter = array())
{
	if(!is_array($filter))
	{
		$filter = array();
	}

	$match = true;

	// by code
	if(array_key_exists('CODE', $filter))
	{
		$fCode = trim((string) $filter['CODE']);

		$code = $this->getCode();
		if($code != $fCode)
		{
			$subCodes = explode('.', $code);
			$found = false;
			foreach($subCodes as $sCode)
			{
				if($sCode == $fCode)
				{
					$found = true;
					break;
				}
			}

			if(!$found)
			{
				$match = false;
			}
		}
	}

	// by type
	if(array_key_exists('TYPE', $filter))
	{
		if($this->getType() != trim((string) $filter['TYPE']))
		{
			$match = false;
		}
	}

	return $match;
}