diff --git a/src/LimitOffset.php b/src/LimitOffset.php index f6b6579..99c30a2 100644 --- a/src/LimitOffset.php +++ b/src/LimitOffset.php @@ -49,6 +49,13 @@ public function limit($limit) return $this; } + public function resetLimit() + { + $this->limit = null; + + return $this; + } + public function hasOffset() { return $this->offset !== null; @@ -72,4 +79,11 @@ public function offset($offset) return $this; } + + public function resetOffset() + { + $this->offset = null; + + return $this; + } } diff --git a/src/LimitOffsetInterface.php b/src/LimitOffsetInterface.php index 87f5073..94628c4 100644 --- a/src/LimitOffsetInterface.php +++ b/src/LimitOffsetInterface.php @@ -31,6 +31,13 @@ public function getLimit(); */ public function limit($limit); + /** + * Reset the limit + * + * @return $this + */ + public function resetLimit(); + /** * Get whether an offset is configured * @@ -54,4 +61,11 @@ public function getOffset(); * @return $this */ public function offset($offset); + + /** + * Reset the offset + * + * @return $this + */ + public function resetOffset(); } diff --git a/src/OrderBy.php b/src/OrderBy.php index efa1a67..0721ad5 100644 --- a/src/OrderBy.php +++ b/src/OrderBy.php @@ -48,6 +48,13 @@ public function orderBy($orderBy, $direction = null) return $this; } + public function resetOrderBy() + { + $this->orderBy = null; + + return $this; + } + /** * Clone the properties provided by this trait * diff --git a/src/OrderByInterface.php b/src/OrderByInterface.php index 6a84683..9cce3d0 100644 --- a/src/OrderByInterface.php +++ b/src/OrderByInterface.php @@ -41,4 +41,11 @@ public function getOrderBy(); * @return $this */ public function orderBy($orderBy, $direction = null); + + /** + * Reset the ORDER BY part of the query + * + * @return $this + */ + public function resetOrderBy(); } diff --git a/src/Select.php b/src/Select.php index 925b600..77a50ee 100644 --- a/src/Select.php +++ b/src/Select.php @@ -462,42 +462,6 @@ public function resetHaving() return $this; } - /** - * Reset the ORDER BY part of the query - * - * @return $this - */ - public function resetOrderBy() - { - $this->orderBy = null; - - return $this; - } - - /** - * Reset the limit of the query - * - * @return $this - */ - public function resetLimit() - { - $this->limit = null; - - return $this; - } - - /** - * Reset the offset of the query - * - * @return $this - */ - public function resetOffset() - { - $this->offset = null; - - return $this; - } - /** * Reset queries combined with UNION and UNION ALL * @@ -510,18 +474,6 @@ public function resetUnion() return $this; } - /** - * Reset the WHERE part of the query - * - * @return $this - */ - public function resetWhere() - { - $this->where = null; - - return $this; - } - /** * Get the count query * diff --git a/src/Where.php b/src/Where.php index 4cda175..f862846 100644 --- a/src/Where.php +++ b/src/Where.php @@ -47,6 +47,13 @@ public function orNotWhere($condition, ...$args) return $this; } + public function resetWhere() + { + $this->where = null; + + return $this; + } + /** * Make $condition an array and build an array like this: [$operator, [$condition]] * diff --git a/src/WhereInterface.php b/src/WhereInterface.php index 8a0a9c4..e724465 100644 --- a/src/WhereInterface.php +++ b/src/WhereInterface.php @@ -74,4 +74,11 @@ public function notWhere($condition, ...$args); * @return $this */ public function orNotWhere($condition, ...$args); + + /** + * Reset the WHERE part of the query + * + * @return $this + */ + public function resetWhere(); }