You are here

protected function WebformOptionsCustomListBuilder::buildInfo in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_options_custom/src/WebformOptionsCustomListBuilder.php \Drupal\webform_options_custom\WebformOptionsCustomListBuilder::buildInfo()

Build information summary.

Return value

array A render array representing the information summary.

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

File

modules/webform_options_custom/src/WebformOptionsCustomListBuilder.php, line 118

Class

WebformOptionsCustomListBuilder
Defines a class to build a listing of webform options custom entities.

Namespace

Drupal\webform_options_custom

Code

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