<?php declare(strict_types=1);
/**
* Shopware
* Copyright © 2020
*
* @category Shopware
* @package SwpPriceOnRequestSix
* @subpackage SwpPriceOnRequestSix.php
*
* @copyright 2020 Iguana-Labs GmbH
* @author Module Factory <info at module-factory.com>
* @license https://www.module-factory.com/eula
*/
namespace Swp\PriceOnRequestSix;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Swp\PriceOnRequestSix\Utils\CustomFieldInstaller;
use Swp\PriceOnRequestSix\Utils\InstallUninstall;
class SwpPriceOnRequestSix extends Plugin
{
public function install(InstallContext $installContext): void
{
parent::install($installContext);
(new InstallUninstall($this->container))->install($installContext->getContext());
}
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
if ($uninstallContext->keepUserData()) {
return;
}
(new InstallUninstall($this->container))->uninstall($uninstallContext->getContext());
(new CustomFieldInstaller($this->container))->uninstall($uninstallContext);
}
public function activate(ActivateContext $activateContext): void
{
(new CustomFieldInstaller($this->container))->activate($activateContext);
parent::activate($activateContext);
}
public function deactivate(DeactivateContext $deactivateContext): void
{
(new CustomFieldInstaller($this->container))->deactivate($deactivateContext);
parent::deactivate($deactivateContext);
}
public function postUpdate(UpdateContext $updateContext): void
{
(new CustomFieldInstaller($this->container))->activate($updateContext);
}
}