Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PhpBackend.php

function PhpBackend::set

Overrides CacheBackendInterface::set

1 call to PhpBackend::set()
PhpBackend::setMultiple in core/lib/Drupal/Core/Cache/PhpBackend.php
Store multiple items in the persistent cache.

File

core/lib/Drupal/Core/Cache/PhpBackend.php, line 157

Class

PhpBackend
Defines a PHP cache implementation.

Namespace

Drupal\Core\Cache

Code

public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {
    assert(Inspector::assertAllStrings($tags), 'Cache Tags must be strings.');
    $item = (object) [
        'cid' => $cid,
        'data' => $data,
        'created' => round(microtime(TRUE), 3),
        'expire' => $expire,
        'tags' => array_unique($tags),
        'checksum' => $this->checksumProvider
            ->getCurrentChecksum($tags),
    ];
    $this->writeItem($this->normalizeCid($cid), $item);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal