traitGetCancelUrl example

$this->messenger()->addStatus($message);
    $this->logDeletionMessage();
  }

  /** * {@inheritdoc} */
  public function getCancelUrl() {
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    $entity = $this->getEntity();
    return $entity->isDefaultTranslation() ? $this->traitGetCancelUrl() : $entity->toUrl('canonical');
  }

  /** * {@inheritdoc} */
  protected function getDeletionMessage() {
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    $entity = $this->getEntity();

    if (!$entity->isDefaultTranslation()) {
      return $this->t('The @entity-type %label @language translation has been deleted.', [
        
Home | Imprint | This part of the site doesn't use cookies.