public function EntityListController::buildOperations

Builds a renderable list of operation links for the entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity on which the linked operations will be performed.

Return value

array A renderable array of operation links.

See also

Drupal\Core\Entity\EntityListController::render()

7 calls to EntityListController::buildOperations()
ActionListController::buildRow in drupal/core/modules/action/lib/Drupal/action/ActionListController.php
Builds a row for an entity in the entity listing.
CategoryListController::buildRow in drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.php
Overrides Drupal\Core\Entity\EntityListController::buildRow().
CustomBlockTypeListController::buildRow in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
Overrides \Drupal\Core\Entity\EntityListController::buildRow().
EntityListController::buildRow in drupal/core/lib/Drupal/Core/Entity/EntityListController.php
Builds a row for an entity in the entity listing.
MenuListController::buildRow in drupal/core/modules/menu/lib/Drupal/menu/MenuListController.php
Overrides \Drupal\Core\Entity\EntityListController::buildRow().

... See full list

1 method overrides EntityListController::buildOperations()

File

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

Class

EntityListController
Provides a generic implementation of an entity list controller.

Namespace

Drupal\Core\Entity

Code

public function buildOperations(EntityInterface $entity) {

  // Retrieve and sort operations.
  $operations = $this
    ->getOperations($entity);
  $this->moduleHandler
    ->alter('entity_operation', $operations, $entity);
  uasort($operations, 'drupal_sort_weight');
  $build = array(
    '#type' => 'operations',
    '#links' => $operations,
  );
  return $build;
}