public function PriceListListBuilder::buildRow in Commerce Pricelist 8
Same name and namespace in other branches
- 8.2 src/PriceListListBuilder.php \Drupal\commerce_pricelist\PriceListListBuilder::buildRow()
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
Return value
array A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
PriceListListBuilder.php, line 29
Class
- PriceListListBuilder
- Defines a class to build a listing of Price list entities.
Namespace
Drupal\commerce_pricelistCode
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\commerce_pricelist\Entity\PriceList */
$name_url = Url::fromRoute('entity.price_list.canonical', [
'price_list' => $entity
->id(),
]);
$name = Link::fromTextAndUrl($entity
->label(), $name_url);
$row['id'] = $entity
->id();
$row['name'] = $name;
return $row + parent::buildRow($entity);
}