You are here

protected function TagListBuilder::getDefaultOperations in Extensible BBCode 4.0.x

Same name and namespace in other branches
  1. 8.3 src/TagListBuilder.php \Drupal\xbbcode\TagListBuilder::getDefaultOperations()

Throws

\Drupal\Core\Entity\EntityMalformedException

\Drupal\Core\Entity\Exception\UndefinedLinkTemplateException

Overrides EntityListBuilder::getDefaultOperations

File

src/TagListBuilder.php, line 43

Class

TagListBuilder
Build a table view of custom tags.

Namespace

Drupal\xbbcode

Code

protected function getDefaultOperations(EntityInterface $entity) : array {
  $operations = parent::getDefaultOperations($entity);
  if (!$entity
    ->access('update')) {
    $operations['view'] = [
      'title' => $this
        ->t('View'),
      'url' => $entity
        ->toUrl('view-form'),
    ];
  }
  $operations['copy'] = [
    'title' => $this
      ->t('Copy'),
    'url' => $entity
      ->toUrl('copy-form'),
    'weight' => 20,
  ];
  return $operations;
}