custom/plugins/HydrokulturNimbitsCustomChanges/src/NimbitsCustomChanges.php line 15

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Nimbits\NimbitsCustomChanges;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Context;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  8. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  9. use Doctrine\DBAL\Connection;
  10. use Nimbits\NimbitsCustomChanges\Schema\SchemaUpgrade;
  11. class NimbitsCustomChanges extends Plugin
  12. {
  13.     public function getViewPaths(): array
  14.     {
  15.         $viewPaths parent::getViewPaths();
  16.         $viewPaths[] = 'Resources/views/storefront';
  17.         return $viewPaths;
  18.     }
  19.     
  20.     public function activate(ActivateContext $context): void
  21.     {
  22.         parent::activate($context);
  23.         SchemaUpgrade::activate($context$this->container);
  24.     }
  25.     
  26.     public function deactivate(DeactivateContext $context): void
  27.     {
  28.         $shopwareContext $context->getContext();
  29.         parent::deactivate($context);
  30.         SchemaUpgrade::deactivate($context$this->container);
  31.     }
  32.     
  33.     public function install(InstallContext $context): void
  34.     {
  35.         parent::install($context);
  36.         SchemaUpgrade::install($context$this->container);
  37.     }
  38.     
  39.     public function uninstall(UninstallContext $context): void
  40.     {
  41.         parent::uninstall($context);
  42.         
  43.         if ($context->keepUserData())
  44.             return;
  45.         
  46.         try{
  47.             //$connection = $this->container->get(Connection::class);
  48.             //$connection->executeQuery('');
  49.                     
  50.         }
  51.         catch(\Exception $e){
  52.             
  53.         }
  54.         
  55.         SchemaUpgrade::uninstall($context$this->container);
  56.         
  57.     }
  58.     
  59. }