mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Ensure DataQuery used in apply() is returned on Filter classes (to be consistent with GreaterThanFilter etc which will return it)
This commit is contained in:
parent
a8e0fd07f2
commit
a9c7c69289
@ -25,7 +25,7 @@ class EndsWithFilter extends SearchFilter {
|
||||
*/
|
||||
public function apply(DataQuery $query) {
|
||||
$this->model = $query->applyRelation($this->relation);
|
||||
$query->where($this->getDbName() . " LIKE '%" . Convert::raw2sql($this->getValue()) . "'");
|
||||
return $query->where($this->getDbName() . " LIKE '%" . Convert::raw2sql($this->getValue()) . "'");
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
|
@ -28,12 +28,11 @@
|
||||
class FulltextFilter extends SearchFilter {
|
||||
|
||||
public function apply(DataQuery $query) {
|
||||
$query->where(sprintf(
|
||||
return $query->where(sprintf(
|
||||
"MATCH (%s) AGAINST ('%s')",
|
||||
$this->getDbName(),
|
||||
Convert::raw2sql($this->getValue())
|
||||
));
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
|
@ -25,7 +25,7 @@ class StartsWithFilter extends SearchFilter {
|
||||
*/
|
||||
public function apply(DataQuery $query) {
|
||||
$this->model = $query->applyRelation($this->relation);
|
||||
$query->where($this->getDbName() . " LIKE '" . Convert::raw2sql($this->getValue()) . "%'");
|
||||
return $query->where($this->getDbName() . " LIKE '" . Convert::raw2sql($this->getValue()) . "%'");
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
|
@ -27,7 +27,7 @@ class WithinRangeFilter extends SearchFilter {
|
||||
|
||||
function apply(DataQuery $query) {
|
||||
$this->model = $query->applyRelation($this->relation);
|
||||
$query->where(sprintf(
|
||||
return $query->where(sprintf(
|
||||
"%s >= '%s' AND %s <= '%s'",
|
||||
$this->getDbName(),
|
||||
Convert::raw2sql($this->min),
|
||||
|
Loading…
Reference in New Issue
Block a user