
| Current Path : /var/www/html/rocksensor1/web/modules/contrib/entity_export_csv/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/modules/contrib/entity_export_csv/src/EntityExportCsvListBuilder.php |
<?php
namespace Drupal\entity_export_csv;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
/**
* Provides a listing of Entity export csv entities.
*/
class EntityExportCsvListBuilder extends ConfigEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['label'] = $this->t('Label');
$header['id'] = $this->t('Machine name');
$header['entity_type_id'] = $this->t('Entity Type ID');
$header['bundle'] = $this->t('Bundle');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity->label();
$row['id'] = $entity->id();
$row['entity_type_id'] = $entity->getTargetEntityTypeId();
$row['bundle'] = $entity->getTargetBundle();
return $row + parent::buildRow($entity);
}
/**
* {@inheritdoc}
*/
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;
}
}