2008-08-09 06:06:52 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Matches on rows where the field is not equal to the given value.
|
|
|
|
*
|
2009-03-22 23:59:14 +01:00
|
|
|
* @package sapphire
|
|
|
|
* @subpackage search
|
2008-08-09 06:06:52 +02:00
|
|
|
*/
|
|
|
|
class NegationFilter extends SearchFilter {
|
|
|
|
|
2011-03-21 09:37:55 +01:00
|
|
|
public function apply(DataQuery $query) {
|
2011-12-09 12:49:24 +01:00
|
|
|
$this->model = $query->applyRelation($this->relation);
|
2011-04-05 13:01:57 +02:00
|
|
|
return $query->where(sprintf(
|
2008-10-05 21:20:35 +02:00
|
|
|
"%s != '%s'",
|
|
|
|
$this->getDbName(),
|
|
|
|
Convert::raw2sql($this->getValue())
|
|
|
|
));
|
2008-08-09 06:06:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|