Permalink
Browse files

MINOR Ensure DataQuery used in apply() is returned on Filter classes …

…(to be consistent with GreaterThanFilter etc which will return it)
  • Loading branch information...
1 parent a8e0fd0 commit a9c7c69289638fc455a6e7dde1b203d70cd05895 @halkyon halkyon committed Jun 15, 2012
@@ -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 @@ function setMax($max) {
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),

0 comments on commit a9c7c69

Please sign in to comment.