public function StoreListBuilder::buildRow in Commerce Core 8.2
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
- modules/
store/ src/ StoreListBuilder.php, line 26
Class
- StoreListBuilder
- Defines the list builder for stores.
Namespace
Drupal\commerce_storeCode
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);
}