You are here

public function PathautoPatternListBuilder::buildRow in Pathauto 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 DraggableListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/PathautoPatternListBuilder.php, line 39

Class

PathautoPatternListBuilder
Provides a listing of Pathauto pattern entities.

Namespace

Drupal\pathauto

Code

public function buildRow(EntityInterface $entity) {

  /* @var \Drupal\pathauto\PathautoPatternInterface $entity */
  $row['label'] = $entity
    ->label();
  $row['pattern']['#markup'] = $entity
    ->getPattern();
  $row['type']['#markup'] = $entity
    ->getAliasType()
    ->getLabel();
  $row['conditions']['#theme'] = 'item_list';
  foreach ($entity
    ->getSelectionConditions() as $condition) {
    $row['conditions']['#items'][] = $condition
      ->summary();
  }
  return $row + parent::buildRow($entity);
}