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