public function ActionListController::getOperations

Overrides \Drupal\Core\Entity\EntityListController::getOperations();

Overrides ConfigEntityListController::getOperations

File

drupal/core/modules/action/lib/Drupal/action/ActionListController.php, line 111
Contains \Drupal\action\ActionListController.

Class

ActionListController
Provides a listing of Actions.

Namespace

Drupal\action

Code

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