Sets the total number of pages.
int $totalItems: The total number of items.
int $limit: The maximum number of items per page.
protected function setTotalPages($totalItems, $limit) { $this->totalPages = (int) ceil($totalItems / $limit); }