You are here

public function ModerationStateTransitionListBuilder::buildRow in Workbench Moderation 8.2

Same name and namespace in other branches
  1. 8 src/ModerationStateTransitionListBuilder.php \Drupal\workbench_moderation\ModerationStateTransitionListBuilder::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

src/ModerationStateTransitionListBuilder.php, line 65

Class

ModerationStateTransitionListBuilder
Provides a listing of Moderation state transition entities.

Namespace

Drupal\workbench_moderation

Code

public function buildRow(EntityInterface $entity) {

  /** @var ModerationStateTransitionInterface $entity */
  $row['label'] = $entity
    ->label();
  $row['id']['#markup'] = $entity
    ->id();
  $row['from']['#markup'] = $this->stateStorage
    ->load($entity
    ->getFromState())
    ->label();
  $row['to']['#markup'] = $this->stateStorage
    ->load($entity
    ->getToState())
    ->label();
  return $row + parent::buildRow($entity);
}