You are here

public function TransactionDeleteForm::getCancelUrl in Transaction 8

Returns the route to go to if the user cancels the action.

Return value

\Drupal\Core\Url A URL object.

Overrides ContentEntityDeleteForm::getCancelUrl

File

src/Form/TransactionDeleteForm.php, line 27

Class

TransactionDeleteForm
Provides a form for deleting a transaction.

Namespace

Drupal\transaction\Form

Code

public function getCancelUrl() {

  /** @var \Drupal\transaction\TransactionInterface $entity */
  $entity = $this
    ->getEntity();
  return $entity
    ->getTargetEntityId() ? $entity
    ->toUrl('collection', [
    'target_entity' => $entity
      ->getTargetEntityId(),
  ]) : $entity
    ->toUrl();
}