SiteSettingEntityDeleteForm.php in Site Settings and Labels 8
File
src/Form/SiteSettingEntityDeleteForm.php
View source
<?php
namespace Drupal\site_settings\Form;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\site_settings\SiteSettingsLoader;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SiteSettingEntityDeleteForm extends ContentEntityDeleteForm {
protected $siteSettingsLoader;
public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, SiteSettingsLoader $site_settings_loader) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);
$this->siteSettingsLoader = $site_settings_loader;
}
public static function create(ContainerInterface $container) {
return new static($container
->get('entity.repository'), $container
->get('entity_type.bundle.info'), $container
->get('datetime.time'), $container
->get('site_settings.loader'));
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->siteSettingsLoader
->clearCache();
parent::submitForm($form, $form_state);
}
}