function BlockContentBlock::getCacheMaxAge

Overrides ContextAwarePluginTrait::getCacheMaxAge

File

core/modules/block_content/src/Plugin/Block/BlockContentBlock.php, line 178

Class

BlockContentBlock
Defines a generic block type.

Namespace

Drupal\block_content\Plugin\Block

Code

public function getCacheMaxAge() {
  $max_age = parent::getCacheMaxAge();
  if (($entity = $this->getEntity()) && $entity instanceof BlockContentInterface) {
    $max_age = Cache::mergeMaxAges($max_age, $entity->getCacheMaxAge());
  }
  return $max_age;
}

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