Version: current

     1 <?php
     2 /**
     3  * Matches on rows where the field is not equal to the given value.
     4  *
     5  * @package sapphire
     6  * @subpackage search
     7  */
     8 class NegationFilter extends SearchFilter {
     9
    10     public function apply(SQLQuery $query) {
    11         return $query->where(sprintf(
    12             "%s != '%s'",
    13             $this->getDbName(),
    14             Convert::raw2sql($this->getValue())
    15         ));
    16     }
    17
    18 }
    19
    20 ?>

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -