You are here

public function EntityExportCsvListBuilder::getDefaultOperations in Entity Export CSV 8

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides ConfigEntityListBuilder::getDefaultOperations

File

src/EntityExportCsvListBuilder.php, line 38

Class

EntityExportCsvListBuilder
Provides a listing of Entity export csv entities.

Namespace

Drupal\entity_export_csv

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->hasLinkTemplate('duplicate')) {
    $operations['duplicate'] = [
      'title' => $this
        ->t('Duplicate'),
      'weight' => 15,
      'url' => $this
        ->ensureDestination($entity
        ->toUrl('duplicate')),
    ];
  }
  return $operations;
}