• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicaterequisitecriterion.php
  • Класс: Bitrix\Crm\Integrity\DuplicateRequisiteCriterion
  • Вызов: DuplicateRequisiteCriterion::setQueryFilter
static function setQueryFilter(Main\Entity\Query $query, array $matches)
{
	$countryId = isset($matches['RQ_COUNTRY_ID']) ? (int)$matches['RQ_COUNTRY_ID'] : null;

	$fieldName = isset($matches['RQ_FIELD_NAME']) ? $matches['RQ_FIELD_NAME'] : '';
	if($fieldName === '')
	{
		throw new Main\ArgumentException("Parameter 'TYPE' is required.", 'matches');
	}

	$value = isset($matches['VALUE']) ? $matches['VALUE'] : '';
	if($value === '')
	{
		throw new Main\ArgumentException("Parameter 'VALUE' is required.", 'matches');
	}

	if ($countryId !== null)
		$query->addFilter('=RQ_COUNTRY_ID', $countryId);
	$query->addFilter('=RQ_FIELD_NAME', $fieldName);
	$query->addFilter('=VALUE', $value);
}