Since: 2.0
Author: Guilherme Blanco (guilhermeblanco@hotmail.com)
Author: Jonathan Wage (jonwage@gmail.com)
Author: Roman Borschel (roman@code-factory.org)
Author: David Abdemoulaie (dave@hobodave.com)
Author: Benjamin Eberlei (kontakt@beberlei.de)
Inheritance: extends Doctrine\Common\Cache\AbstractCache
Beispiel #1
0
 /**
  * Puts data into the cache.
  *
  * $id can be specified as an array of key-value pairs: array( 'alpha' => 'xyz', 'beta' => 'qrs', 'gamma' => 'lmo', ... )
  *
  *
  * @param string|array $id       The cache id or array of key-value pairs
  * @param mixed        $data     The cache entry/data.
  * @param int          $lifeTime The cache lifetime. Sets a specific lifetime for this cache entry. Defaults to 0, or "never expire"
  *
  * @return boolean|boolean[] TRUE if the entry was successfully stored in the cache, FALSE otherwise.
  */
 public function set($id, $data = null, $lifeTime = self::DEFAULT_CACHE_TTL)
 {
     if (is_array($id) && null === $data) {
         $_result = array();
         foreach ($id as $_key => $_value) {
             $_result[$_key] = $this->_store->save($_key, $_value, $lifeTime);
         }
         return $_result;
     }
     return $this->_store->save($id, $data, $lifeTime);
 }