示例#1
0
 /**
  * Returns an singleton instance of this class
  * @return
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new ItemMapper();
     }
     return self::$instance;
 }
示例#2
0
文件: feed.php 项目: nitewol/reader
 function items($items = null)
 {
     if (is_null($items)) {
         //getting items
         if (isset($this->items)) {
             return $this->items;
         } else {
             $this->items = ItemMapper::instance()->find_all_by_sql('feed_id = ' . $this->id());
             return $this->items;
         }
     } else {
         //setting items
         $this->items = $items;
     }
 }
示例#3
0
文件: item.php 项目: nitewol/reader
 function mapper()
 {
     return ItemMapper::instance();
 }
示例#4
0
文件: item.php 项目: nitewol/reader
<?php

include 'header.php';
$item = ItemMapper::instance()->find($_GET['id']);
?>

<?php 
$feed_helper = new FeedHelper();
?>

<?php 
echo $feed_helper->link($item->feed());
?>

<h2><?php 
echo $item->title();
?>
</h2>

<?php 
echo $item->body();
include 'footer.php';