src/xPDO/Cache/xPDOCacheManager.php
public function set($key, & $var, $lifetime= 0, $options= array()) {
        $return= false;
        if ($cache = $this->getCacheProvider($this->getOption(xPDO::OPT_CACHE_KEY, $options), $options)) {
            $value= null;
            if (is_object($var) && $var instanceof \xPDO\Om\xPDOObject) {
                $value= $var->toArray('', true);
            } else {
                $value= $var;
            }
            $return= $cache->set($key, $value, $lifetime, $options);
        } else {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'No cache implementation found.');
        }
        return $return;
    }
public function set($key, & $var, $lifetime= 0, $options= array()) {
        $return= false;
        if ($cache = $this->getCacheProvider($this->getOption(xPDO::OPT_CACHE_KEY, $options), $options)) {
            $value= null;
            if (is_object($var) && $var instanceof \xPDO\Om\xPDOObject) {
                $value= $var->toArray('', true);
            } else {
                $value= $var;
            }
            $return= $cache->set($key, $value, $lifetime, $options);
        } else {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'No cache implementation found.');
        }
        return $return;
    }
public function set ( $ key , & $ var , $ lifetime = 0 , $ options = array ( ) ) { $ return = false ; if ( $ cache = $ this -> getCacheProvider ( $ this -> getOption ( xPDO :: OPT_CACHE_KEY , $ options ) , $ options ) ) { $ value = null ; if ( is_object ( $ var ) && $ var instanceof \ xPDO \ Om \ xPDOObject ) { $ value = $ var -> toArray ( '' , true ) ; } else { $ value = $ var ; } $ return = $ cache -> set ( $ key , $ value , $ lifetime , $ options ) ; } else { $ this -> xpdo -> log ( xPDO :: LOG_LEVEL_ERROR , 'No cache implementation found.' ) ; } return $ return ; }
Set a key-value pair in a cache provider.

@access public
@param string $key A unique key identifying the item being set.
@param mixed & $var A reference to the PHP variable representing the item.
@param integer $lifetime Seconds the item will be valid in objcache.
@param array $options Additional options for the cache set operation.
@return boolean True if the set was successful
Set a key - value pair in a cache provider .