/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entityLayoutManager->removeContentBlock($this->entityLayoutBlock); drupal_set_message($this->t('The @label block has been removed', ['@label' => $this->entityLayoutBlock->label()])); $form_state->setRedirectUrl($this->getCancelUrl()); }
/** * Remove the supplied block content. * * @param EntityLayoutBlockInterface $block */ public function removeContentBlock(EntityLayoutBlockInterface $entityLayoutBlock) { return $entityLayoutBlock->delete(); }