diff --git a/src/XIVAPI/Api/ContentHandler.php b/src/XIVAPI/Api/ContentHandler.php index dd2d06e..351858e 100644 --- a/src/XIVAPI/Api/ContentHandler.php +++ b/src/XIVAPI/Api/ContentHandler.php @@ -8,6 +8,8 @@ class ContentHandler { /** @var string */ private $contentName; + private $page = 1; + private $limiti = 100; public function setContentName(string $name): ContentHandler { @@ -22,6 +24,30 @@ public function one($id) public function list() { - return Guzzle::get("/{$this->contentName}"); + return Guzzle::get("/{$this->contentName}", [ + "query" => [ + "page" => $this->page, + "limit" => $this->limit, + ], + ]); } + + public function setPage(int $page): ContentHandler + { + $this->page = $page; + return $this; + } + + public function setLimit(int $limit): ContentHandler + { + $this->limit = $limit; + return $this; + } + + public function next() + { + $this->setPage($this->page + 1); + return $this->list(); + } + }