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()

3 calls to EntityListController::buildOperations()
CategoryListController::buildRow in drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.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.
ViewListController::buildOperations in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php
Overrides Drupal\Core\Entity\EntityListController::buildOperations();
1 method overrides EntityListController::buildOperations()

File

drupal/core/lib/Drupal/Core/Entity/EntityListController.php, line 131
Definition of 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);
  uasort($operations, 'drupal_sort_weight');
  $build = array(
    '#type' => 'operations',
    '#links' => $operations,
  );
  return $build;
}