From 16e0ba4f5222fb2fd1f7378966f1548907bf7ebc Mon Sep 17 00:00:00 2001 From: Stas Pazhoha Date: Sat, 6 Aug 2016 11:51:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D1=82=D0=BE=D0=B4=20addOffset($off?= =?UTF-8?q?set)=20=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B5=20VkParams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/VKApi/VkParams.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/VKApi/VkParams.php b/src/VKApi/VkParams.php index 0137c88..7e0c158 100644 --- a/src/VKApi/VkParams.php +++ b/src/VKApi/VkParams.php @@ -50,4 +50,14 @@ public function existsParam($key) { return array_key_exists($key, $this->params); } + + public function addOffset($offset = 100) + { + $old_offset = 0; + $offset = (int) $offset; + if ($this->existsParam("offset")) { + $old_offset = (int) $this->get("offset"); + } + return $this->set("offset", $old_offset + $offset); + } } \ No newline at end of file