protected function getNumberOfPages()
    {
        $numberOfPages = \ceil($this->totalCount / $this->itemsPerPage);

        if ($this->maximumNumberOfLinks > $numberOfPages) {
            return $numberOfPages;
        }
        return $numberOfPages;
    }