
| Current Path : /var/www/html/store/web/modules/contrib/commerce/modules/store/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/store/web/modules/contrib/commerce/modules/store/src/StoreListBuilder.php |
<?php
namespace Drupal\commerce_store;
use Drupal\commerce_store\Entity\StoreType;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
/**
* Defines the list builder for stores.
*/
class StoreListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['name'] = $this->t('Name');
$header['type'] = $this->t('Type');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\commerce_store\Entity\StoreInterface $entity */
$store_type = StoreType::load($entity->bundle());
$row['name']['data'] = [
'#type' => 'link',
'#title' => $entity->label(),
] + $entity->toUrl()->toRenderArray();
$row['type'] = $store_type->label();
return $row + parent::buildRow($entity);
}
}