CI_Cache::save PHP Method

save() public method

Cache Save
public save ( string $id, mixed $data, integer $ttl = 60, boolean $raw = FALSE ) : boolean
$id string Cache ID
$data mixed Data to store
$ttl integer Cache TTL (in seconds)
$raw boolean Whether to store the raw value
return boolean TRUE on success, FALSE on failure
    public function save($id, $data, $ttl = 60, $raw = FALSE)
    {
        return $this->{$this->_adapter}->save($this->key_prefix . $id, $data, $ttl, $raw);
    }

Usage Example

Exemplo n.º 1
0
 public function save($key, $value, $minutesToLive)
 {
     if ($this->isReady()) {
         $this->ciCache->save($key, $value, $minutesToLive);
         return true;
     }
     return false;
 }