t('Are you sure you want to revert %id to default?', ['%id' => $this->entity->id()]); } /** * {@inheritdoc} */ public function getCancelUrl() { return new Url('entity.jsonapi_resource_config.collection'); } /** * {@inheritdoc} */ public function getConfirmText() { return $this->t('Revert'); } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message($this->t('Resource %id has been reverted to default.', [ '%id' => $this->entity->id(), ])); $form_state->setRedirectUrl($this->getCancelUrl()); } }