You are here

protected function WebformOptionsListBuilder::buildInfo in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformOptionsListBuilder.php \Drupal\webform\WebformOptionsListBuilder::buildInfo()

Build information summary.

Return value

array A render array representing the information summary.

1 call to WebformOptionsListBuilder::buildInfo()
WebformOptionsListBuilder::render in src/WebformOptionsListBuilder.php
Builds the entity listing as renderable array for table.html.twig.

File

src/WebformOptionsListBuilder.php, line 106

Class

WebformOptionsListBuilder
Defines a class to build a listing of webform options entities.

Namespace

Drupal\webform

Code

protected function buildInfo() {
  $total = $this
    ->getQuery($this->keys, $this->category)
    ->count()
    ->execute();
  if (!$total) {
    return [];
  }
  return [
    '#markup' => $this
      ->formatPlural($total, '@count option', '@count options'),
    '#prefix' => '<div>',
    '#suffix' => '</div>',
  ];
}