<?php declare(strict_types=1);
namespace ShopWithMe\UI;
use Shopware\Core\Framework\Plugin;
use Shopware\Storefront\Framework\ThemeInterface;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use ShopWithMe\UI\Lifecycle\InstallerFactory;
use ShopWithMe\UI\Service\InstallerInterface;
class ShopWithMeUI extends Plugin implements ThemeInterface
{
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;
}
}
}