You are here

public function MapRenderEvent::addCacheTags in farmOS 2.x

Add cache tags to the render element.

Parameters

array $tags: An array of cache tags.

File

modules/core/map/src/Event/MapRenderEvent.php, line 114

Class

MapRenderEvent
An event that is dispatched before rendering a map on the page.

Namespace

Drupal\farm_map\Event

Code

public function addCacheTags(array $tags) {
  $existing = [];
  if (!empty($this->element['#cache']['tags'])) {
    $existing = $this->element['#cache']['tags'];
  }
  $this->element['#cache']['tags'] = array_unique(array_merge($tags, $existing));
}