
| Current Path : /var/www/html/musik/web/modules/contrib/entity_export_csv/src/Form/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/musik/web/modules/contrib/entity_export_csv/src/Form/EntityExportCsvDisableForm.php |
<?php
namespace Drupal\entity_export_csv\Form;
use Drupal;
use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/**
* Class EntityExportCsvDisableForm.
*
* @package Drupal\entity_export_csv\Form
*/
class EntityExportCsvDisableForm extends EntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Disable @type: %label?', [
'@type' => $this->entity->getEntityType()->getLabel(),
'%label' => $this->entity->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('Disable @type: %label?', [
'@type' => $this->entity->getEntityType()->getLabel(),
'%label' => $this->entity->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
$type = $this->entity->getEntityType()->get('id');
return new Url("entity.$type.collection");
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
$entity = $this->entity;
$entity->disable()->save();
Drupal::logger('entity_export_csv')->notice('%type configuration %id disabled', [
'%type' => $entity->get('entityTypeId'),
'%id' => $entity->id(),
]);
parent::submitForm($form, $form_state);
$form_state->setRedirectUrl($this->getCancelUrl());
}
}