You are here

public function EasyEmailTypeListBuilder::getDefaultOperations in Easy Email 2.0.x

Same name and namespace in other branches
  1. 8 src/EasyEmailTypeListBuilder.php \Drupal\easy_email\EasyEmailTypeListBuilder::getDefaultOperations()

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides ConfigEntityListBuilder::getDefaultOperations

File

src/EasyEmailTypeListBuilder.php, line 36

Class

EasyEmailTypeListBuilder
Provides a listing of Email type entities.

Namespace

Drupal\easy_email

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if (!empty($operations['edit'])) {
    $operations['edit']['title'] = $this
      ->t('Edit Template');
  }
  $operations['preview'] = [
    'title' => $this
      ->t('Preview Template'),
    'weight' => 15,
    'url' => Url::fromRoute('entity.easy_email_type.preview', [
      'easy_email_type' => $entity
        ->id(),
    ]),
  ];
  return $operations;
}