/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Save a selected replacement in the image style storage. It will be used // later, in the same request, when resolving dependencies. if ($replacement = $form_state->getValue('replacement')) { /** @var \Drupal\image\ImageStyleStorageInterface $storage */ $storage = $this->entityTypeManager->getStorage($this->entity->getEntityTypeId()); $storage->setReplacementId($this->entity->id(), $replacement); } parent::submitForm($form, $form_state); }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Locked menus may not be deleted. if ($this->entity->isLocked()) { return; } // Delete all links to the overview page for this menu. // @todo Add a more generic helper function to the menu link plugin // manager to remove links to a entity or other ID used as a route // parameter that is being removed. Also, consider moving this to // menu_ui.module as part of a generic response to entity deletion. // https://www.drupal.org/node/2310329 $menu_links = $this->menuLinkManager->loadLinksByRoute('entity.menu.edit_form', array('menu' => $this->entity->id()), TRUE); foreach ($menu_links as $id => $link) { $this->menuLinkManager->removeDefinition($id); } parent::submitForm($form, $form_state); }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->set('replacementID', $form_state->getValue('replacement')); parent::submitForm($form, $form_state); }