custom/plugins/FroshPlatformMailArchive/src/FroshPlatformMailArchive.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Frosh\MailArchive;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. use Shopware\Core\System\SystemConfig\SystemConfigService;
  8. class FroshPlatformMailArchive extends Plugin
  9. {
  10.     public function install(InstallContext $installContext): void
  11.     {
  12.         $this->container->get(SystemConfigService::class)->set('FroshPlatformMailArchive.config.deleteMessageAfterDays'90);
  13.     }
  14.     public function uninstall(UninstallContext $uninstallContext): void
  15.     {
  16.         if ($uninstallContext->keepUserData()) {
  17.             return;
  18.         }
  19.         $this->container->get(Connection::class)->executeQuery('DROP TABLE IF EXISTS frosh_mail_archive');
  20.     }
  21. }