function BlockListBuilder::getDefaultOperations

Same name and namespace in other branches
  1. 11.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::getDefaultOperations()
  2. 10 core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::getDefaultOperations()
  3. 9 core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::getDefaultOperations()
  4. 8.9.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::getDefaultOperations()

Overrides ConfigEntityListBuilder::getDefaultOperations

File

core/modules/block/src/BlockListBuilder.php, line 360

Class

BlockListBuilder
Defines a class to build a listing of block entities.

Namespace

Drupal\block

Code

protected function getDefaultOperations(EntityInterface $entity) {
  $args = func_get_args();
  $cacheability = $args[1] ?? new CacheableMetadata();
  $operations = parent::getDefaultOperations($entity, $cacheability);
  if (isset($operations['edit'])) {
    $operations['edit']['title'] = $this->t('Configure');
  }
  if (isset($operations['delete'])) {
    $operations['delete']['title'] = $this->t('Remove');
  }
  return $operations;
}

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