You are here

public function MenuLinkEntity::getCacheMaxAge in Admin Toolbar 8.2

Same name and namespace in other branches
  1. 3.x admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php \Drupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity::getCacheMaxAge()

The maximum age for which this object may be cached.

Return value

int The maximum time in seconds that this object may be cached.

Overrides MenuLinkBase::getCacheMaxAge

File

admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php, line 100

Class

MenuLinkEntity
Provides a menu link plugins for configuration entities.

Namespace

Drupal\admin_toolbar_tools\Plugin\Menu

Code

public function getCacheMaxAge() {
  if ($this->entity) {
    return $this->entity
      ->getCacheMaxAge();
  }
  return parent::getCacheMaxAge();
}