model = $query->applyRelation($this->relation); $value = $this->getDbFormattedValue(); if(is_numeric($value)) $filter = sprintf("%s < %s", $this->getDbName(), Convert::raw2sql($value)); else $filter = sprintf("%s < '%s'", $this->getDbName(), Convert::raw2sql($value)); return $query->where($filter); } public function isEmpty() { return $this->getValue() == null || $this->getValue() == ''; } }