custom/plugins/SwagPlatformDemoData/src/SwagPlatformDemoData.php line 14

  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. namespace Swag\PlatformDemoData;
  8. use Shopware\Core\Framework\Plugin;
  9. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  10. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  11. class SwagPlatformDemoData extends Plugin
  12. {
  13.     public function activate(ActivateContext $activateContext): void
  14.     {
  15.         // @phpstan-ignore-next-line
  16.         $this->container->get(DemoDataService::class)->generate($activateContext->getContext());
  17.     }
  18.     public function deactivate(DeactivateContext $deactivateContext): void
  19.     {
  20.         // @phpstan-ignore-next-line
  21.         $this->container->get(DemoDataService::class)->delete($deactivateContext->getContext());
  22.     }
  23. }