You are here

public function FacetListBuilder::buildFacetSummaryRow in Facets 8

Builds an array of facet summary for display in the overview.

1 call to FacetListBuilder::buildFacetSummaryRow()
FacetListBuilder::buildForm in src/FacetListBuilder.php
Form constructor.

File

src/FacetListBuilder.php, line 142

Class

FacetListBuilder
Builds a listing of facet entities.

Namespace

Drupal\facets

Code

public function buildFacetSummaryRow(FacetsSummaryInterface $entity) {
  $row = parent::buildRow($entity);
  return [
    'type' => [
      '#theme_wrappers' => [
        'container' => [
          '#attributes' => [
            'class' => 'facets-summary-type',
          ],
        ],
      ],
      '#type' => 'markup',
      '#markup' => 'Facets Summary',
    ],
    'machine_name' => [
      '#markup' => $entity
        ->id(),
    ],
    'title' => [
      '#theme_wrappers' => [
        'container' => [
          '#attributes' => [
            'class' => 'facets-title',
          ],
        ],
      ],
      '#type' => 'link',
      '#title' => $entity
        ->label(),
      '#attributes' => [
        'class' => [
          'search-api-title',
        ],
      ],
      '#wrapper_attributes' => [
        'colspan' => 2,
      ],
    ] + $entity
      ->toUrl('edit-form')
      ->toRenderArray(),
    'operations' => $row['operations'],
    '#attributes' => [
      'title' => $this
        ->t('ID: @name', [
        '@name' => $entity
          ->id(),
      ]),
      'class' => [
        'facet',
      ],
    ],
  ];
}