CachingIterator::offsetSet
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
CachingIterator::offsetSet — Set an element in the cache
Description
Stores value under key in
the cache.
This method is called when a value is assigned to the
CachingIterator with array syntax, such as
$iterator['key'] = $value.
The inner iterator is not modified.
The CachingIterator::FULL_CACHE flag must be set.
Parameters
key
The key of the element to be set.
value
The new value for the key.
Return Values
No value is returned.
Errors/Exceptions
Throws a BadMethodCallException if the
CachingIterator::FULL_CACHE flag is not set.
See Also
- CachingIterator::offsetGet() - Return an element from the cache
- CachingIterator::offsetUnset() - Remove an element from the cache
- CachingIterator::getCache() - Retrieve the contents of the cache
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
