public function paginate(int $count)
    {
        $this->count = $count;

        $this->treatmentPerPage();
                        
        if ($this->perPage !== null) {
            $this->nbPages = ceil($this->count / $this->perPage);
        } else {
            $this->nbPages = 1;
        }

        if ($this->getP !== null && $this->getP > 0 && $this->getP <= $this->nbPages && preg_match(self::REGEX_INTEGER, $this->getP)) {
            $this->currentPage = $this->getP;
        } else {
            $this->currentPage = 1;
        }

        $this->setLimitAndSetOffset();
    }
public function paginate(int $count)
    {
        $this->count = $count;

        $this->treatmentPerPage();
                        
        if ($this->perPage !== null) {
            $this->nbPages = ceil($this->count / $this->perPage);
        } else {
            $this->nbPages = 1;
        }

        if ($this->getP !== null && $this->getP > 0 && $this->getP <= $this->nbPages && preg_match(self::REGEX_INTEGER, $this->getP)) {
            $this->currentPage = $this->getP;
        } else {
            $this->currentPage = 1;
        }

        $this->setLimitAndSetOffset();
    }
public function paginate ( int $ count ) { $ this -> count = $ count ; $ this -> treatmentPerPage ( ) ; if ( $ this -> perPage !== null ) { $ this -> nbPages = ceil ( $ this -> count / $ this -> perPage ) ; } else { $ this -> nbPages = 1 ; } if ( $ this -> getP !== null && $ this -> getP > 0 && $ this -> getP <= $ this -> nbPages && preg_match ( self :: REGEX_INTEGER , $ this -> getP ) ) { $ this -> currentPage = $ this -> getP ; } else { $ this -> currentPage = 1 ; } $ this -> setLimitAndSetOffset ( ) ; }
Active la pagination

@param int $count - Nombre d'éléments à paginer
Active la pagination