/** @return PaginatedWikiPages */ public function getPaginatedUserPages(PFUser $user, $project_id, $limit, $offset, $pagename) { $pages = array(); if ($pagename !== '') { $row_pages = $this->dao->searchPaginatedUserWikiPagesByPagename($project_id, $limit, $offset, $pagename); } else { $row_pages = $this->dao->searchPaginatedUserWikiPages($project_id, $limit, $offset); } $total_size = (int) $this->dao->foundRows(); foreach ($row_pages as $page) { $wiki_page = new WikiPage($project_id, $page['pagename']); if ($wiki_page->isAutorized($user->getId())) { $pages[] = $wiki_page; } } return new PaginatedWikiPages($pages, $total_size); }