SiteSettingEntityTypeListBuilder.php in Site Settings and Labels 8
File
src/SiteSettingEntityTypeListBuilder.php
View source
<?php
namespace Drupal\site_settings;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class SiteSettingEntityTypeListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Site Setting type');
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
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;
}
}