private function calculateTotalPages()
    {
        // With zero items, there is still one page
        if ($this->getTotalItems() === 0) {
            $this->setTotalPages(1);
            return;
        }

        // The total amount of pages is calculated by dividing the total amount of items by the items per page
        $totalPages = ceil($this->getTotalItems() / $this->getLimit());

        $this->setTotalPages((int)$totalPages);
    }
private function calculateTotalPages()
    {
        // With zero items, there is still one page
        if ($this->getTotalItems() === 0) {
            $this->setTotalPages(1);
            return;
        }

        // The total amount of pages is calculated by dividing the total amount of items by the items per page
        $totalPages = ceil($this->getTotalItems() / $this->getLimit());

        $this->setTotalPages((int)$totalPages);
    }
private function calculateTotalPages ( ) { // With zero items, there is still one page if ( $ this -> getTotalItems ( ) === 0 ) { $ this -> setTotalPages ( 1 ) ; return ; } // The total amount of pages is calculated by dividing the total amount of items by the items per page $ totalPages = ceil ( $ this -> getTotalItems ( ) / $ this -> getLimit ( ) ) ; $ this -> setTotalPages ( ( int ) $ totalPages ) ; }
Calculates the total amount of pages.
Calculates the total amount of pages .