Example #1
0
 /**
  * @return bool|Users_Entity|null
  */
 public function getUser()
 {
     if ($this->user == null) {
         $this->user = Table::instance()->fetchOne($this->getId());
     }
     return $this->user;
 }
Example #2
0
 private function showPostList($catPk = false)
 {
     #get posts
     $postTable = Table::instance();
     $postsSelect = $postTable->select();
     $postsSelect->publishedIs(1);
     if (!empty($catPk)) {
         $postsSelect->category_idIs($catPk);
     }
     $postsSelect->order('date', 'DESC');
     $currentPage = (!empty($_GET['page']) and $_GET['page'] > 1) ? intval($_GET['page']) : 1;
     $onPage = 10;
     $postsSelect->pageLimit($currentPage, $onPage);
     $data = $postTable->fetchPage($postsSelect);
     $data['currentPage'] = $currentPage;
     $data['onPage'] = $onPage;
     $this->render('list', $data);
 }