From 1ff5c35de5dbd70a782875a91dd2232fd01b002b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:38:04 +0200 Subject: Adding upstream version 0.10.1. Signed-off-by: Daniel Baumann --- vendor/ipl/sql/src/LimitOffset.php | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 vendor/ipl/sql/src/LimitOffset.php (limited to 'vendor/ipl/sql/src/LimitOffset.php') diff --git a/vendor/ipl/sql/src/LimitOffset.php b/vendor/ipl/sql/src/LimitOffset.php new file mode 100644 index 0000000..99c30a2 --- /dev/null +++ b/vendor/ipl/sql/src/LimitOffset.php @@ -0,0 +1,89 @@ +limit !== null; + } + + public function getLimit() + { + return $this->limit; + } + + public function limit($limit) + { + if ($limit !== null) { + $limit = (int) $limit; + if ($limit < 0) { + $limit = null; + } + } + + $this->limit = $limit; + + return $this; + } + + public function resetLimit() + { + $this->limit = null; + + return $this; + } + + public function hasOffset() + { + return $this->offset !== null; + } + + public function getOffset() + { + return $this->offset; + } + + public function offset($offset) + { + if ($offset !== null) { + $offset = (int) $offset; + if ($offset <= 0) { + $offset = null; + } + } + + $this->offset = $offset; + + return $this; + } + + public function resetOffset() + { + $this->offset = null; + + return $this; + } +} -- cgit v1.2.3