multiAdd() public method (available since version 2.0.7)
Stores multiple items in cache. Each item contains a value identified by a key.
If the cache already contains such a key, the existing value and expiration time will be preserved.
public boolean multiAdd ( $items, $duration = 0, $dependency = null ) | ||
---|---|---|
$items | array |
The items to be cached, as key-value pairs. |
$duration | integer |
Default number of seconds in which the cached values will expire. 0 means never expire. |
$dependency | yii\caching\Dependency |
Dependency of the cached items. If the dependency changes, the corresponding values in the cache will be invalidated when it is fetched via get(). This parameter is ignored if $serializer is false. |
return | boolean |
Whether the items are successfully stored into cache |
Please login to continue.