/** * write_data_to_persistence method * * Write data to persistance layer. If that fails - false is returned. * Exceptions are suspended, as cache write is not a fatal error by no * mean, thus shall not be escalated further. If you want exception to * be escalated - use lower layer method directly. * * @param mixed $data Unserialized data to write * * @return boll Success */ public function write_data_to_persistence($data) { $return = true; try { $return = $this->cache_strategy->write_data($this->key_for_persistance, $data); } catch (Ai1ec_Cache_Write_Exception $e) { $return = false; } return $return; }
/** * write_data_to_persistence method * * Write data to persistance layer. If that fails - false is returned. * Exceptions are suspended, as cache write is not a fatal error by no * mean, thus shall not be escalated further. If you want exception to * be escalated - use lower layer method directly. * * @param string $data * * @return boll Success */ public function write_data_to_persistence($data) { $success = true; try { if (!$this->cache_strategy->write_data($this->key_for_persistance, $data)) { $success = false; } } catch (Ai1ec_Cache_Write_Exception $e) { $success = false; } return $success; }