You are here

public function ExchangeRatesListBuilder::buildRow in Commerce Exchanger 8

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/ExchangeRatesListBuilder.php, line 27

Class

ExchangeRatesListBuilder
Provides a listing of Exchange rates entities.

Namespace

Drupal\commerce_exchanger

Code

public function buildRow(EntityInterface $entity) {
  $configuration = $entity
    ->getPluginConfiguration();
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $row['mode'] = $configuration['mode'] ?? 'live';
  $row['status'] = $entity
    ->status() ? $this
    ->t('Enabled') : $this
    ->t('Disabled');

  // You probably want a few more properties here...
  return $row + parent::buildRow($entity);
}