/** * Get next results page. * * @return mixed */ public function getNext() { $range = $this->getNextRange(); $headers = array_merge($this->headers, array('range' => $this->buildRangeHeader($range['start'], $range['end']))); try { $response = $this->client->get($this->path, $this->parameters, $headers); $contentRange = $response->getContentRange(); $this->count = $contentRange['count']; $this->limit = $contentRange['end'] - $contentRange['start'] + 1; $this->offset = $contentRange['end'] + 1; return $this->hydrate($response->getContent()); } catch (UpholdClientException $e) { if (412 === $e->getHttpCode() || 416 === $e->getHttpCode()) { return $this->hydrate(array()); } throw $e; } }