function ViewListBuilder::buildRow

Same name in other branches
  1. 9 core/modules/views_ui/src/ViewListBuilder.php \Drupal\views_ui\ViewListBuilder::buildRow()
  2. 8.9.x core/modules/views_ui/src/ViewListBuilder.php \Drupal\views_ui\ViewListBuilder::buildRow()
  3. 11.x core/modules/views_ui/src/ViewListBuilder.php \Drupal\views_ui\ViewListBuilder::buildRow()

Overrides EntityListBuilder::buildRow

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 83

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',
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.