You are here

public function BlocacheMetadata::getMetadata in Blocache (Block Cache Control) 8

Gets the cache metadata defined for the block.

Return value

array If the user defined custom metadata, these values will be returned; otherwise, the values defined by Drupal or other modules will be returned.

In both cases an array is returned with the following keys:

  • max-age
  • contexts
  • tags

File

src/BlocacheMetadata.php, line 88

Class

BlocacheMetadata
Class BlocacheMetadata.

Namespace

Drupal\blocache

Code

public function getMetadata() {
  if ($this
    ->isOverridden()) {
    return $this
      ->getOverrides();
  }
  return $this
    ->getDefaults();
}