function MemoryCache::set
Overrides MemoryBackend::set
1 call to MemoryCache::set()
- LruMemoryCache::set in core/lib/ Drupal/ Core/ Cache/ MemoryCache/ LruMemoryCache.php 
- Stores data in the persistent cache.
1 method overrides MemoryCache::set()
- LruMemoryCache::set in core/lib/ Drupal/ Core/ Cache/ MemoryCache/ LruMemoryCache.php 
- Stores data in the persistent cache.
File
- 
              core/lib/ Drupal/ Core/ Cache/ MemoryCache/ MemoryCache.php, line 50 
Class
- MemoryCache
- Defines a memory cache implementation.
Namespace
Drupal\Core\Cache\MemoryCacheCode
public function set($cid, $data, $expire = MemoryCacheInterface::CACHE_PERMANENT, array $tags = []) {
  assert(Inspector::assertAllStrings($tags), 'Cache tags must be strings.');
  $tags = array_unique($tags);
  $this->cache[$cid] = (object) [
    'cid' => $cid,
    'data' => $data,
    'created' => $this->time
      ->getRequestTime(),
    'expire' => $expire,
    'tags' => $tags,
  ];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
