- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/compatible/compatible.php
- Класс: BitrixSaleCompatibleOrderQuery
- Вызов: OrderQuery::compatibleAddFilter
public function compatibleAddFilter($key, $value)
{
$keyMatch = static::explodeFilterKey($key);
$modifier = $keyMatch['modifier'];
$operator = $keyMatch['operator'];
$alias = $keyMatch['alias' ];
if (! $name = $this->getAliasName($alias))
return $this;
switch ($operator)
{
case '':
case '@': $operator = ($modifier === '*' ? '' : '=');
break;
case '~': $operator = '';
break;
// default: with no changes
}
switch ($modifier)
{
case '*':
case '' : return $this->addFilter($modifier.$operator.$name, $value);
case '!': return $operator == '=' && $value
? $this->addFilter(null, array('LOGIC' => 'OR', array('!='.$name => $value), array('='.$name => '')))
: $this->addFilter($modifier.$operator.$name, $value);
case '+': return $this->addFilter(null, array('LOGIC' => 'OR', array($operator.$name => $value), array('='.$name => '')));
default : throw new SystemException("invalid modifier '$modifier'", 0, __FILE__, __LINE__);
}
}