2008-08-09 06:38:44 +02:00
|
|
|
<?php
|
2008-08-09 08:40:50 +02:00
|
|
|
/**
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage search
|
|
|
|
*/
|
|
|
|
|
2008-08-09 06:38:44 +02:00
|
|
|
/**
|
|
|
|
* Uses a substring match against content in column rows.
|
|
|
|
*
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage search
|
|
|
|
*/
|
|
|
|
class SubstringFilter extends SearchFilter {
|
|
|
|
|
|
|
|
public function apply(SQLQuery $query) {
|
2008-08-11 01:03:35 +02:00
|
|
|
return $query->where("LOCATE('{$this->getValue()}', {$this->getDbName()}) != 0");
|
2008-08-09 06:38:44 +02:00
|
|
|
}
|
2008-08-11 02:03:57 +02:00
|
|
|
|
|
|
|
public function isEmpty() {
|
|
|
|
return $this->getValue() == null || $this->getValue() == '';
|
|
|
|
}
|
2008-08-09 06:38:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|