You are here

public function AppListBuilder::render in Apigee Edge 8

Builds the entity listing as renderable array for table.html.twig.

@todo Add a link to add a new item to the #empty text.

Overrides EdgeEntityListBuilder::render

1 call to AppListBuilder::render()
TeamAppListByTeam::render in modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php
Builds the entity listing as renderable array for table.html.twig.
1 method overrides AppListBuilder::render()
TeamAppListByTeam::render in modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php
Builds the entity listing as renderable array for table.html.twig.

File

src/Entity/ListBuilder/AppListBuilder.php, line 214

Class

AppListBuilder
General app list builder for developer and team apps.

Namespace

Drupal\apigee_edge\Entity\ListBuilder

Code

public function render() {
  $build = parent::render();

  // Add user cache contexts.
  $build['#cache']['contexts'][] = 'user';
  $build['#cache']['contexts'][] = 'user.permissions';
  if ($this
    ->usingDisplayType(static::VIEW_MODE_DISPLAY_TYPE)) {
    return $build;
  }
  $build['table']['#attributes']['class'][] = 'table--app-list';
  $build['table']['#rows'] = [];
  $build['table']['#empty'] = $this
    ->t('Looks like you do not have any apps. Get started by adding one.');
  foreach ($this
    ->load() as $entity) {
    $rows = [];
    $this
      ->buildInfoRow($entity, $rows);
    $this
      ->buildWarningRow($entity, $rows);
    $build['table']['#rows'] += $rows;
  }
  $build['#attached']['library'][] = 'apigee_edge/apigee_edge.app_listing';
  return $build;
}