t('Are you sure you want to delete the environment indicator %title?', ['%title' => $this->entity->label()]); } /** * {@inheritdoc} */ public function getCancelUrl() { return new Url('aggregator.admin_overview'); } /** * {@inheritdoc} */ public function getDescription() { return $this->t('Deleting a environment will make disappear the indicator.'); } /** * {@inheritdoc} */ public function getConfirmText() { return $this->t('Delete'); } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message($this->t('Deleted environment %name.', ['%name' => $this->entity->label()])); // TODO: Figure out how to log stuff to the watchdog. // watchdog('environment', 'Deleted environment %name.', ['%name' => $this->entity->label()), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/config/development/environment-indicator'; Cache::invalidateTags(['content' => TRUE]); } }