You are here

public function ViewListBuilder::buildRow in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 91
Contains \Drupal\views_ui\ViewListBuilder.

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 array(
    'data' => array(
      'view_name' => array(
        'data' => array(
          '#theme' => 'views_ui_view_info',
          '#view' => $view,
          '#displays' => $this
            ->getDisplaysList($view),
        ),
      ),
      'description' => array(
        'data' => array(
          '#plain_text' => $view
            ->get('description'),
        ),
        'class' => array(
          'views-table-filter-text-source',
        ),
      ),
      'tag' => $view
        ->get('tag'),
      'path' => array(
        'data' => array(
          '#theme' => 'item_list',
          '#items' => $this
            ->getDisplayPaths($view),
          '#context' => [
            'list_style' => 'comma-list',
          ],
        ),
      ),
      'operations' => $row['operations'],
    ),
    'title' => $this
      ->t('Machine name: @name', array(
      '@name' => $view
        ->id(),
    )),
    'class' => array(
      $view
        ->status() ? 'views-ui-list-enabled' : 'views-ui-list-disabled',
    ),
  );
}