PhotosImageDeleteForm.php in Album Photos 8.5
File
src/Form/PhotosImageDeleteForm.php
View source
<?php
namespace Drupal\photos\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
class PhotosImageDeleteForm extends ContentEntityDeleteForm {
public function getFormId() {
return 'photos_image_confirm_delete';
}
public function getQuestion() {
return $this
->t('Do you want to delete this image %title?', [
'%title' => $this->entity
->label(),
]);
}
public function getDescription() {
return $this
->t('Only do this if you are sure!');
}
public function getConfirmText() {
return $this
->t('Delete it!');
}
public function getCancelText() {
return $this
->t('Nevermind');
}
protected function getRedirectUrl() {
$entity = $this
->getEntity();
return $entity
->getAlbumUrl();
}
protected function logDeletionMessage() {
$entity = $this
->getEntity();
$this
->logger('photos')
->notice('Deleted image %title.', [
'%title' => $entity
->label(),
]);
}
}