framework/caching/CCache.php
public function set($id,$value,$expire=0,$dependency=null)
	{
		Yii::trace('Saving "'.$id.'" to cache','system.caching.'.get_class($this));

		if ($dependency !== null && $this->serializer !== false)
			$dependency->evaluateDependency();

		if ($this->serializer === null)
			$value = serialize(array($value,$dependency));
		elseif ($this->serializer !== false)
			$value = call_user_func($this->serializer[0], array($value,$dependency));

		return $this->setValue($this->generateUniqueKey($id), $value, $expire);
	}
public function set($id,$value,$expire=0,$dependency=null)
	{
		Yii::trace('Saving "'.$id.'" to cache','system.caching.'.get_class($this));

		if ($dependency !== null && $this->serializer !== false)
			$dependency->evaluateDependency();

		if ($this->serializer === null)
			$value = serialize(array($value,$dependency));
		elseif ($this->serializer !== false)
			$value = call_user_func($this->serializer[0], array($value,$dependency));

		return $this->setValue($this->generateUniqueKey($id), $value, $expire);
	}
public function set ( $ id , $ value , $ expire = 0 , $ dependency = null ) { Yii :: trace ( 'Saving "' . $ id . '" to cache' , 'system.caching.' . get_class ( $ this ) ) ; if ( $ dependency !== null && $ this -> serializer !== false ) $ dependency -> evaluateDependency ( ) ; if ( $ this -> serializer === null ) $ value = serialize ( array ( $ value , $ dependency ) ) ; elseif ( $ this -> serializer !== false ) $ value = call_user_func ( $ this -> serializer [ 0 ] , array ( $ value , $ dependency ) ) ; return $ this -> setValue ( $ this -> generateUniqueKey ( $ id ) , $ value , $ expire ) ; }
Stores a value identified by a key into cache.
If the cache already contains such a key, the existing value and
expiration time will be replaced with the new ones.

@param string $id the key identifying the value to be cached
@param mixed $value the value to be cached
@param integer $expire the number of seconds in which the cached value will expire. 0 means never expire.
@param ICacheDependency $dependency dependency of the cached item. If the dependency changes, the item is labeled invalid.
@return boolean true if the value is successfully stored into cache, false otherwise
Stores a value identified by a key into cache . If the cache already contains such a key the existing value and expiration time will be replaced with the new ones .