You are here

public function CachePluginBase::getRowCacheTags in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getRowCacheTags()
  2. 9 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 316

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;
}