public function getTotalPages()
    {
        if (!isset($this->pages)) {
            $recordCount = $this->getTotalRecordCount();
            if ($this->max > 0) {
                $this->pages = ceil($recordCount / $this->max);
            } else {
                $this->pages = 0;
            }
        }

        return $this->pages;
    }
public function getTotalPages()
    {
        if (!isset($this->pages)) {
            $recordCount = $this->getTotalRecordCount();
            if ($this->max > 0) {
                $this->pages = ceil($recordCount / $this->max);
            } else {
                $this->pages = 0;
            }
        }

        return $this->pages;
    }
public function getTotalPages ( ) { if ( ! isset ( $ this -> pages ) ) { $ recordCount = $ this -> getTotalRecordCount ( ) ; if ( $ this -> max > 0 ) { $ this -> pages = ceil ( $ recordCount / $ this -> max ) ; } else { $ this -> pages = 0 ; } } return $ this -> pages ; }
get total pages

@return int $this->pages
get total pages