mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 05:09:06 +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) {
|
public function apply(DataQuery $query) {
|
||||||
$this->model = $query->applyRelation($this->relation);
|
$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() {
|
public function isEmpty() {
|
||||||
|
@ -28,12 +28,11 @@
|
|||||||
class FulltextFilter extends SearchFilter {
|
class FulltextFilter extends SearchFilter {
|
||||||
|
|
||||||
public function apply(DataQuery $query) {
|
public function apply(DataQuery $query) {
|
||||||
$query->where(sprintf(
|
return $query->where(sprintf(
|
||||||
"MATCH (%s) AGAINST ('%s')",
|
"MATCH (%s) AGAINST ('%s')",
|
||||||
$this->getDbName(),
|
$this->getDbName(),
|
||||||
Convert::raw2sql($this->getValue())
|
Convert::raw2sql($this->getValue())
|
||||||
));
|
));
|
||||||
return $query;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isEmpty() {
|
public function isEmpty() {
|
||||||
|
@ -25,7 +25,7 @@ class StartsWithFilter extends SearchFilter {
|
|||||||
*/
|
*/
|
||||||
public function apply(DataQuery $query) {
|
public function apply(DataQuery $query) {
|
||||||
$this->model = $query->applyRelation($this->relation);
|
$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() {
|
public function isEmpty() {
|
||||||
|
@ -27,7 +27,7 @@ class WithinRangeFilter extends SearchFilter {
|
|||||||
|
|
||||||
function apply(DataQuery $query) {
|
function apply(DataQuery $query) {
|
||||||
$this->model = $query->applyRelation($this->relation);
|
$this->model = $query->applyRelation($this->relation);
|
||||||
$query->where(sprintf(
|
return $query->where(sprintf(
|
||||||
"%s >= '%s' AND %s <= '%s'",
|
"%s >= '%s' AND %s <= '%s'",
|
||||||
$this->getDbName(),
|
$this->getDbName(),
|
||||||
Convert::raw2sql($this->min),
|
Convert::raw2sql($this->min),
|
||||||
|
Loading…
Reference in New Issue
Block a user