Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::buildOperations()
  2. 9 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::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\EntityListBuilder::buildRow()

5 calls to EntityListBuilder::buildOperations()
BlockListBuilder::buildBlocksForm in core/modules/block/src/BlockListBuilder.php
Builds the main "Blocks" portion of the form.
ConfigTranslationBlockListBuilder::buildRow in core/modules/config_translation/src/Controller/ConfigTranslationBlockListBuilder.php
Builds a row for an entity in the entity listing.
EntityListBuilder::buildRow in core/lib/Drupal/Core/Entity/EntityListBuilder.php
Builds a row for an entity in the entity listing.
NodeListBuilder::buildRow in core/modules/node/src/NodeListBuilder.php
Builds a row for an entity in the entity listing.
PathAliasListBuilder::buildRow in core/modules/path/src/PathAliasListBuilder.php
Builds a row for an entity in the entity listing.
1 method overrides EntityListBuilder::buildOperations()
TestEntityListBuilder::buildOperations in core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
Builds a renderable list of operation links for the entity.

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function buildOperations(EntityInterface $entity) {
  $build = [
    '#type' => 'operations',
    '#links' => $this
      ->getOperations($entity),
    // Allow links to use modals.
    '#attached' => [
      'library' => [
        'core/drupal.dialog.ajax',
      ],
    ],
  ];
  return $build;
}