public function one_by_icode($icode, $is_force = false) { $cache_key = $this->CACHE_PREFIX . $this->table_name . '*' . $icode; if (!$is_force) { $row = FwCache::get_value($cache_key); } if ($is_force || is_null($row)) { $row = db_row($this->table_name, array('icode' => $icode)); FwCache::set_value($cache_key, $row); } return $row; }
/** * clears whole cache * @return nothing */ public static function clear() { self::$storage = array(); }
public function cache_remove($id) { $cache_key = $this->CACHE_PREFIX . $this->table_name . '*' . $id; FwCache::remove($cache_key); }