Example #1
0
 public function fetchByPk($pk)
 {
     static $tpls = array();
     if (!isset($tpls[$pk])) {
         $tpls[$pk] = parent::fetchByPk($pk);
     }
     return $tpls[$pk];
 }
Example #2
0
 public function updateClickCount($id, $clickCount = 0)
 {
     if (empty($clickCount)) {
         $record = parent::fetchByPk($id);
         $clickCount = $record["clickcount"];
     }
     return parent::modify($id, array("clickcount" => $clickCount + 1));
 }