function Sql::getCacheTags

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::getCacheTags()
  2. 8.9.x core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::getCacheTags()
  3. 11.x core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::getCacheTags()

Overrides QueryPluginBase::getCacheTags

File

core/modules/views/src/Plugin/views/query/Sql.php, line 1693

Class

Sql
Views query plugin for an SQL query.

Namespace

Drupal\views\Plugin\views\query

Code

public function getCacheTags() {
    $tags = [];
    // Add cache tags for each row, if there is an entity associated with it.
    if (!$this->hasAggregate) {
        foreach ($this->getAllEntities() as $entity) {
            $tags = Cache::mergeTags($entity->getCacheTags(), $tags);
        }
    }
    return $tags;
}

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