function CachePluginBase::getRowCacheTags

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getRowCacheTags()
  2. 10 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getRowCacheTags()
  3. 11.x core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getRowCacheTags()

Returns the row cache tags.

Parameters

\Drupal\views\ResultRow $row: A result row.

Return value

string[] The row cache tags.

1 call to CachePluginBase::getRowCacheTags()
CachePluginBase::getRowId in core/modules/views/src/Plugin/views/cache/CachePluginBase.php
Returns a unique identifier for the specified row.

File

core/modules/views/src/Plugin/views/cache/CachePluginBase.php, line 315

Class

CachePluginBase
The base plugin to handle caching.

Namespace

Drupal\views\Plugin\views\cache

Code

public function getRowCacheTags(ResultRow $row) {
    $tags = !empty($row->_entity) ? $row->_entity
        ->getCacheTags() : [];
    if (!empty($row->_relationship_entities)) {
        foreach ($row->_relationship_entities as $entity) {
            $tags = Cache::mergeTags($tags, $entity->getCacheTags());
        }
    }
    return $tags;
}

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