entityManager()->getStorage('shortcut')->create(['shortcut_set' => $shortcut_set->id()]); return $this->entityFormBuilder()->getForm($shortcut, 'add'); } /** * Deletes the selected shortcut. * * @param \Drupal\shortcut\ShortcutInterface $shortcut * The shortcut to delete. * * @return \Symfony\Component\HttpFoundation\RedirectResponse * A redirect to the previous location or the front page when destination * is not set. */ public function deleteShortcutLinkInline(ShortcutInterface $shortcut) { $label = $shortcut->label(); try { $shortcut->delete(); $this->messenger()->addStatus($this->t('The shortcut %title has been deleted.', ['%title' => $label])); } catch (\Exception $e) { $this->messenger()->addStatus($this->t('Unable to delete the shortcut for %title.', ['%title' => $label]), 'error'); } return $this->redirect(''); } }