• Модуль: biconnector
  • Путь к файлу: ~/bitrix/modules/biconnector/lib/controller/key.php
  • Класс: BitrixBIConnectorControllerKey
  • Вызов: Key::prepareFilter
private function prepareFilter(array $filter): array
{
	$result = [];
	foreach ($filter as $code => $value)
	{
		$filterType = '';
		$matches = [];
		if (preg_match('/^(W{1,2})(.+)/', $code, $matches) && $matches[2])
		{
			$filterType = $matches[1];
			$code = $matches[2];
		}

		if (in_array($code, self::ALLOW_FILTER_FIELDS, true))
		{
			if ($code === 'USER_ID')
			{
				if (is_array($value))
				{
					foreach ($value as $k => $val)
					{
						$value[$k] = $this->prepareUserId((int)$val);
					}
					$value = array_unique($value);
				}
				else
				{
					$value = $this->prepareUserId((int)$value);
				}
			}

			$result[$filterType . $code] = $value;
		}
	}

	return $result;
}