function ViewsData::cacheSet

Same name and namespace in other branches
  1. 9 core/modules/views/src/ViewsData.php \Drupal\views\ViewsData::cacheSet()
  2. 8.9.x core/modules/views/src/ViewsData.php \Drupal\views\ViewsData::cacheSet()
  3. 10 core/modules/views/src/ViewsData.php \Drupal\views\ViewsData::cacheSet()

Sets data to the cache backend.

Parameters

string $cid: The cache ID to set.

mixed $data: The data that will be cached.

2 calls to ViewsData::cacheSet()
ViewsData::get in core/modules/views/src/ViewsData.php
Gets data for a particular table.
ViewsData::getData in core/modules/views/src/ViewsData.php
Gets all data invoked by hook_views_data().

File

core/modules/views/src/ViewsData.php, line 185

Class

ViewsData
Class to manage and lazy load cached views data.

Namespace

Drupal\views

Code

protected function cacheSet($cid, $data) {
    return $this->cacheBackend
        ->set($this->prepareCid($cid), $data, Cache::PERMANENT, [
        'views_data',
        'config:core.extension',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.