You are here

public function SiteSettingEntityTypeListBuilder::getOperations in Site Settings and Labels 8

Provides an array of information to build a list of operation links.

Parameters

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

Return value

array An associative array of operation link data for this list, keyed by operation name, containing the following key-value pairs:

  • title: The localized title of the operation.
  • url: An instance of \Drupal\Core\Url for the operation URL.
  • weight: The weight of this operation.

Overrides EntityListBuilder::getOperations

File

src/SiteSettingEntityTypeListBuilder.php, line 35

Class

SiteSettingEntityTypeListBuilder
Provides a listing of Site Setting type entities.

Namespace

Drupal\site_settings

Code

public function getOperations(EntityInterface $entity) {
  $operations = parent::getOperations($entity);
  $operations['replicate'] = [
    'title' => $this
      ->t('Replicate'),
    'url' => Url::fromRoute("site_settings.site_setting_replicate_form", [
      'setting' => $entity
        ->id(),
    ]),
    'weight' => 200,
  ];
  return $operations;
}