src/Sulu/Component/Rest/Listing/ListRestHelper.php
public function getTotalPages($totalNumber = null)
    {
        if (is_null($totalNumber)) {
            $totalNumber = $this->totalNumberOfElements;
        }

        return $this->getLimit() ? (ceil($totalNumber / $this->getLimit())) : 1;
    }
public function getTotalPages($totalNumber = null)
    {
        if (is_null($totalNumber)) {
            $totalNumber = $this->totalNumberOfElements;
        }

        return $this->getLimit() ? (ceil($totalNumber / $this->getLimit())) : 1;
    }
public function getTotalPages ( $ totalNumber = null ) { if ( is_null ( $ totalNumber ) ) { $ totalNumber = $ this -> totalNumberOfElements ; } return $ this -> getLimit ( ) ? ( ceil ( $ totalNumber / $ this -> getLimit ( ) ) ) : 1 ; }
returns total amount of pages.

@param int $totalNumber if not defined the total number is requested from DB

@return float|int
returns total amount of pages .