<?php declare(strict_types=1);
namespace ShopWithMe\HitPay;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use ShopWithMe\HitPay\Lifecycle\InstallerFactory;
use ShopWithMe\HitPay\Service\InstallerInterface;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
class ShopWithMeHitPay extends Plugin
{
public function install(InstallContext $installContext): void
{
$this->getInstaller()->install($installContext);
}
public function update(UpdateContext $updateContext): void
{
$this->getInstaller()->update($updateContext);
}
protected function getInstaller(): InstallerInterface
{
$factory = new InstallerFactory($this->container);
return $factory->create();
}
/**
* @param UninstallContext $context
*/
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
// $connection = $this->container->get(Connection::class);
// $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_point`');
// $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_config`');
}
}