function EntityListBuilder::getOperations

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()
  3. 10 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getOperations()

Overrides EntityListBuilderInterface::getOperations

4 calls to EntityListBuilder::getOperations()
ConfigTranslationEntityListBuilder::getOperations in core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
EntityDisplayModeListBuilder::getOperations in core/modules/field_ui/src/EntityDisplayModeListBuilder.php
EntityListBuilder::buildOperations in core/lib/Drupal/Core/Entity/EntityListBuilder.php
Builds a renderable list of operation links for the entity.
UserListBuilder::getOperations in core/modules/user/src/UserListBuilder.php
Provides an array of information to build a list of operation links.
3 methods override EntityListBuilder::getOperations()
ConfigTranslationEntityListBuilder::getOperations in core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
EntityDisplayModeListBuilder::getOperations in core/modules/field_ui/src/EntityDisplayModeListBuilder.php
UserListBuilder::getOperations in core/modules/user/src/UserListBuilder.php
Provides an array of information to build a list of operation links.

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function getOperations(EntityInterface $entity) {
    $operations = $this->getDefaultOperations($entity);
    $operations += $this->moduleHandler()
        ->invokeAll('entity_operation', [
        $entity,
    ]);
    $this->moduleHandler
        ->alter('entity_operation', $operations, $entity);
    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.