getAll() 공개 정적인 메소드

Get all items (at least a chunk)
public static getAll ( integer $limit = 10, integer $offset ) : array
$limit integer The number of items to get.
$offset integer The offset.
리턴 array
예제 #1
0
 /**
  * Parse
  */
 private function parse()
 {
     // get RSS-link
     $rssTitle = $this->get('fork.settings')->get('Blog', 'rss_title_' . FRONTEND_LANGUAGE);
     $rssLink = FrontendNavigation::getURLForBlock('Blog', 'Rss');
     // add RSS-feed into the metaCustom
     $this->header->addRssLink($rssTitle, $rssLink);
     // assign comments
     $this->tpl->assign('widgetBlogRecentArticlesList', FrontendBlogModel::getAll($this->get('fork.settings')->get('Blog', 'recent_articles_list_num_items', 5)));
     $this->tpl->assign('widgetBlogRecentArticlesFullRssLink', $rssLink);
 }
예제 #2
0
파일: Index.php 프로젝트: bwgraves/forkcms
 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('Blog');
     $this->pagination['limit'] = $this->get('fork.settings')->get('Blog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendBlogModel::getAllCount();
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // get articles
     $this->items = FrontendBlogModel::getAll($this->pagination['limit'], $this->pagination['offset']);
 }
예제 #3
0
파일: Rss.php 프로젝트: forkcms/forkcms
 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     $this->items = FrontendBlogModel::getAll(30);
     $this->settings = $this->get('fork.settings')->getForModule('Blog');
 }