You are here

public function PatternListBuilder::buildRow in View Mode Page 3.2.x

Same name and namespace in other branches
  1. 8.3 src/Form/PatternListBuilder.php \Drupal\view_mode_page\Form\PatternListBuilder::buildRow()
  2. 4.0.x src/Form/PatternListBuilder.php \Drupal\view_mode_page\Form\PatternListBuilder::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/Form/PatternListBuilder.php, line 35

Class

PatternListBuilder
Provides a listing of Viewmodepage pattern entities.

Namespace

Drupal\view_mode_page\Form

Code

public function buildRow(EntityInterface $entity) {

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