protected function calculatePages()
    {
        $this->total_pages = ceil($this->total_records / $this->page_size);

        if (
            $this->total_pages <= 1 ||
            $this->total_pages == $this->current_page
        ) {
            $this->next_page = 0;
        } else {
            $this->next_page = $this->current_page + 1;
        }

        if ($this->current_page > 0) {
            $this->prev_page = $this->current_page - 1;
        } else {
            $this->prev_page = 0;
        }
    }