public function MegaMenuList::buildRow in The Better Mega Menu 8
Same name and namespace in other branches
- 2.x src/Controller/MegaMenuList.php \Drupal\tb_megamenu\Controller\MegaMenuList::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 EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
Controller/ MegaMenuList.php, line 27
Class
- MegaMenuList
- Provides a listing of MegaMenuConfig entities.
Namespace
Drupal\tb_megamenu\ControllerCode
public function buildRow(EntityInterface $entity) {
$menu_info = Menu::load($entity->menu);
$row['menu'] = $entity->menu;
$row['label'] = $menu_info !== NULL ? $menu_info
->label() : "MISSING MENU! Was it deleted?";
$row['theme'] = $entity->theme;
return $row + parent::buildRow($entity);
}