caching\Cache set()

set() public method

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, respectively.

public boolean set ( $key, $value, $duration = 0, $dependency = null )
$key mixed

A key identifying the value to be cached. This can be a simple string or a complex data structure consisting of factors representing the key.

$value mixed

The value to be cached

$duration integer

The number of seconds in which the cached value will expire. 0 means never expire.

$dependency yii\caching\Dependency

Dependency of the cached item. If the dependency changes, the corresponding value in the cache will be invalidated when it is fetched via get(). This parameter is ignored if $serializer is false.

return boolean

Whether the value is successfully stored into cache

doc_Yii
2016-10-30 16:53:54
Comments
Leave a Comment

Please login to continue.