function SystemMenuOffCanvasForm::getEntityForm

Same name in other branches
  1. 9 core/modules/system/src/Form/SystemMenuOffCanvasForm.php \Drupal\system\Form\SystemMenuOffCanvasForm::getEntityForm()
  2. 8.9.x core/modules/system/src/Form/SystemMenuOffCanvasForm.php \Drupal\system\Form\SystemMenuOffCanvasForm::getEntityForm()
  3. 11.x core/modules/system/src/Form/SystemMenuOffCanvasForm.php \Drupal\system\Form\SystemMenuOffCanvasForm::getEntityForm()

Gets the entity form for this menu.

Parameters

\Drupal\system\MenuInterface $menu: The menu entity.

Return value

\Drupal\Core\Entity\EntityFormInterface The entity form.

File

core/modules/system/src/Form/SystemMenuOffCanvasForm.php, line 157

Class

SystemMenuOffCanvasForm
The setting_tray form handler for the SystemMenuBlock.

Namespace

Drupal\system\Form

Code

protected function getEntityForm(MenuInterface $menu) {
    $entity_form = $this->entityTypeManager
        ->getFormObject('menu', 'edit');
    $entity_form->setEntity($menu);
    return $entity_form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.