Ejemplo n.º 1
0
 public function get_one($primary_value = '', $select = '', $where = '')
 {
     $use_cache = false;
     if ($primary_value && empty($select) && empty($where)) {
         $use_cache = true;
     }
     if ($use_cache) {
         $cachename = $this->cache_prefix . $primary_value;
         if (!($result = $this->cache->get($cachename))) {
             $result = parent::get_one($primary_value);
             $this->cache->save($cachename, $result, $this->cache_time);
         }
     } else {
         $result = parent::get_one($primary_value, $select, $where);
     }
     return $result;
 }