function EntityListBuilder::getOperations

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
  2. 10 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
  3. 9 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
  4. 8.9.x core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
3 methods override EntityListBuilder::getOperations()
BlockContentListBuilder::getOperations in core/modules/block_content/src/BlockContentListBuilder.php
Provides an array of information to build a list of operation links.
ConfigTranslationEntityListBuilder::getOperations in core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
Provides an array of information to build a list of operation links.
EntityDisplayModeListBuilder::getOperations in core/modules/field_ui/src/EntityDisplayModeListBuilder.php
Provides an array of information to build a list of operation links.

File

core/lib/Drupal/Core/Entity/EntityListBuilder.php, line 132

Class

EntityListBuilder
Defines a generic implementation to build a listing of entities.

Namespace

Drupal\Core\Entity

Code

public function getOperations(EntityInterface $entity) {
  $args = func_get_args();
  $cacheability = $args[1] ?? new CacheableMetadata();
  $operations = $this->getDefaultOperations($entity, $cacheability);
  $operations += $this->moduleHandler()
    ->invokeAll('entity_operation', [
    $entity,
    $cacheability,
  ]);
  $this->moduleHandler
    ->alter('entity_operation', $operations, $entity, $cacheability);
  uasort($operations, '\\Drupal\\Component\\Utility\\SortArray::sortByWeightElement');
  return $operations;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.