closedquestion-8.x-3.x-dev/src/Form/ClosedQuestionDeleteForm.php

src/Form/ClosedQuestionDeleteForm.php
<?php

namespace Drupal\closedquestion\Form;

use Drupal\Core\Entity\ContentEntityDeleteForm;

/**
 * Provides a form for deleting an entity.
 *
 * @internal
 */
class ClosedQuestionDeleteForm extends ContentEntityDeleteForm {

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

    if (!$entity->isDefaultTranslation()) {
      return $this->t('@language translation of the question %label has been deleted.', [
        '@language' => $entity->language()->getName(),
        '%label' => $entity->label(),
      ]);
    }

    return $this->t('The question %title has been deleted.', [
      '%title' => $this->getEntity()->label(),
    ]);
  }

  /**
   * {@inheritdoc}
   */
  protected function logDeletionMessage() {
    /** @var \Drupal\closedquestion\Entity\ClosedQuestionInterface $entity */
    $entity = $this->getEntity();
    $this->logger('closedquestion')->notice('Question %title has been deleted.', ['%title' => $entity->label()]);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc