You are here

public function TourListBuilder::getOperations in Tour UI 8

Provides an array of information to build a list of operation links.

Parameters

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

Return value

array An associative array of operation link data for this list, keyed by operation name, containing the following key-value pairs:

  • title: The localized title of the operation.
  • url: An instance of \Drupal\Core\Url for the operation URL.
  • weight: The weight of this operation.

Overrides EntityListBuilder::getOperations

File

src/TourListBuilder.php, line 81

Class

TourListBuilder
Provides a listing of tours.

Namespace

Drupal\tour_ui

Code

public function getOperations(EntityInterface $entity) {
  $operations = parent::getOperations($entity);
  $operations['edit'] = [
    'title' => t('Edit'),
    'url' => $entity
      ->toUrl('edit-form'),
    'weight' => 1,
  ];
  $operations['delete'] = [
    'title' => t('Delete'),
    'url' => $entity
      ->toUrl('delete-form'),
    'weight' => 2,
  ];
  return $operations;
}