public function getTotalPages($pageSize) { $total = count($this->blogs); return ceil($total / $pageSize); }