min = $min; } public function setMax($max) { $this->max = $max; } protected function applyOne(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $predicate = sprintf('%1$s >= ? AND %1$s <= ?', $this->getDbName()); return $query->where(array( $predicate => array( $this->min, $this->max ) )); } protected function excludeOne(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $predicate = sprintf('%1$s < ? OR %1$s > ?', $this->getDbName()); return $query->where(array( $predicate => array( $this->min, $this->max ) )); } }