You are here

public function ToolbarMenuElementListBuilder::buildRow in Toolbar Menu 8

Same name and namespace in other branches
  1. 8.2 src/ToolbarMenuElementListBuilder.php \Drupal\toolbar_menu\ToolbarMenuElementListBuilder::buildRow()

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides DraggableListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/ToolbarMenuElementListBuilder.php, line 33

Class

ToolbarMenuElementListBuilder
Provides a listing of Toolbar menu element entities.

Namespace

Drupal\toolbar_menu

Code

public function buildRow(EntityInterface $entity) {

  /* @var \Drupal\toolbar_menu\Entity\ToolbarMenuElement $entity */
  $row['label'] = $entity
    ->label();
  $row['menu']['#markup'] = $entity
    ->loadMenu()
    ->label();
  $row['rewrite_label']['#markup'] = $entity
    ->rewriteLabel() ? $this
    ->t('Yes') : $this
    ->t('No');
  return $row + parent::buildRow($entity);
}