You are here

protected function WebformEntityListBuilder::buildInfo in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformEntityListBuilder.php \Drupal\webform\WebformEntityListBuilder::buildInfo()

Build information summary.

Return value

array A render array representing the information summary.

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

File

src/WebformEntityListBuilder.php, line 219

Class

WebformEntityListBuilder
Defines a class to build a listing of webform entities.

Namespace

Drupal\webform

Code

protected function buildInfo() {

  // Display info.
  if ($this->currentUser
    ->hasPermission('administer webform') && ($total = $this
    ->getTotal($this->keys, $this->category, $this->state))) {
    return [
      '#markup' => $this
        ->formatPlural($total, '@total webform', '@total webforms', [
        '@total' => $total,
      ]),
      '#prefix' => '<div>',
      '#suffix' => '</div>',
    ];
  }
  else {
    return [];
  }
}