Provides a form for deleting a node.
Expanded class hierarchy of JobItemAbortForm
class JobItemAbortForm extends ContentEntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this
->t('Are you sure you want to abort the job item %title?', array(
'%title' => $this->entity
->label(),
));
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this
->t('Aborted job items can no longer be accepted. The provider will not be notified.');
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return $this->entity
->toUrl();
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\tmgmt\Entity\JobItem $entity */
$entity = $this->entity;
try {
if (!$entity
->abortTranslation()) {
tmgmt_write_request_messages($entity);
}
} catch (TMGMTException $e) {
$this
->messenger()
->addError(t('Job item cannot be aborted: %error.', array(
'%error' => $e
->getMessage(),
)));
}
$form_state
->setRedirectUrl($this->entity
->toUrl());
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JobItemAbortForm:: |
public | function | ||
JobItemAbortForm:: |
public | function | ||
JobItemAbortForm:: |
public | function | ||
JobItemAbortForm:: |
public | function |