public function PatternListBuilder::buildRow in View Mode Page 4.0.x
Same name and namespace in other branches
- 8.3 src/Form/PatternListBuilder.php \Drupal\view_mode_page\Form\PatternListBuilder::buildRow()
- 3.2.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\FormCode
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);
}