public function TaxRateListBuilder::buildRow in Ubercart 8.4
Same name in this branch
- 8.4 uc_tax/src/TaxRateListBuilder.php \Drupal\uc_tax\TaxRateListBuilder::buildRow()
- 8.4 uc_tax/src/Controller/TaxRateListBuilder.php \Drupal\uc_tax\Controller\TaxRateListBuilder::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 DraggableListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- uc_tax/
src/ TaxRateListBuilder.php, line 90
Class
- TaxRateListBuilder
- Provides a listing of tax rate entities.
Namespace
Drupal\uc_taxCode
public function buildRow(EntityInterface $entity) {
$plugin = $entity
->getPlugin();
$row['label'] = $entity
->label();
$row['description']['#markup'] = $plugin
->getSummary();
$row['shippable']['#markup'] = $entity
->isForShippable() ? $this
->t('Shippable products') : $this
->t('Any product');
$row['product_types']['#markup'] = implode(', ', $entity
->getProductTypes());
$row['line_item_types']['#markup'] = implode(', ', $entity
->getLineItemTypes());
$row['status']['#markup'] = $entity
->status() ? $this
->t('Enabled') : $this
->t('Disabled');
return $row + parent::buildRow($entity);
}