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-10-05 21:20:35 +02:00
|
|
|
return $query->where(sprintf(
|
|
|
|
"LOCATE('%s', %s) != 0",
|
|
|
|
Convert::raw2sql($this->getValue()),
|
|
|
|
$this->getDbName()
|
|
|
|
));
|
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
|
|
|
}
|
|
|
|
|
|
|
|
?>
|