ProductBundleListBuilder.php in Commerce Product Bundle 8
File
src/ProductBundleListBuilder.php
View source
<?php
namespace Drupal\commerce_product_bundle;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
use Drupal\Core\Url;
class ProductBundleListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Product bundle ID');
$header['name'] = $this
->t('Name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['name'] = Link::fromTextAndUrl($entity
->label(), new Url('entity.commerce_product_bundle.edit_form', [
'commerce_product_bundle' => $entity
->id(),
]));
return $row + parent::buildRow($entity);
}
}