public function EntityListController::getOperations

Implements \Drupal\Core\Entity\EntityListControllerInterface::getOperations().

Overrides EntityListControllerInterface::getOperations

2 calls to EntityListController::getOperations()
ConfigEntityListController::getOperations in drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php
Overrides \Drupal\Core\Entity\EntityListController::getOperations();
EntityListController::buildOperations in drupal/core/lib/Drupal/Core/Entity/EntityListController.php
Builds a renderable list of operation links for the entity.
1 method overrides EntityListController::getOperations()

File

drupal/core/lib/Drupal/Core/Entity/EntityListController.php, line 96
Contains \Drupal\Core\Entity\EntityListController.

Class

EntityListController
Provides a generic implementation of an entity list controller.

Namespace

Drupal\Core\Entity

Code

public function getOperations(EntityInterface $entity) {
  $uri = $entity
    ->uri();
  $operations['edit'] = array(
    'title' => t('Edit'),
    'href' => $uri['path'] . '/edit',
    'options' => $uri['options'],
    'weight' => 10,
  );
  $operations['delete'] = array(
    'title' => t('Delete'),
    'href' => $uri['path'] . '/delete',
    'options' => $uri['options'],
    'weight' => 100,
  );
  return $operations;
}