You are here

public function ViewListBuilder::buildRow in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views_ui/src/ViewListBuilder.php \Drupal\views_ui\ViewListBuilder::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 EntityListBuilder::buildRow

See also

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

1 call to ViewListBuilder::buildRow()
ViewListBuilder::render in core/modules/views_ui/src/ViewListBuilder.php
Builds the entity listing as renderable array for table.html.twig.

File

core/modules/views_ui/src/ViewListBuilder.php, line 88

Class

ViewListBuilder
Defines a class to build a listing of view entities.

Namespace

Drupal\views_ui

Code

public function buildRow(EntityInterface $view) {
  $row = parent::buildRow($view);
  return [
    'data' => [
      'view_name' => [
        'data' => [
          '#plain_text' => $view
            ->label(),
        ],
      ],
      'machine_name' => [
        'data' => [
          '#plain_text' => $view
            ->id(),
        ],
      ],
      'description' => [
        'data' => [
          '#plain_text' => $view
            ->get('description'),
        ],
      ],
      'displays' => [
        'data' => [
          '#theme' => 'views_ui_view_displays_list',
          '#displays' => $this
            ->getDisplaysList($view),
        ],
      ],
      'operations' => $row['operations'],
    ],
    '#attributes' => [
      'class' => [
        $view
          ->status() ? 'views-ui-list-enabled' : 'views-ui-list-disabled',
      ],
    ],
  ];
}