<?php declare(strict_types=1);
namespace MoorlProductAccessories;
use Doctrine\DBAL\Connection;
use MoorlFoundation\Core\PluginFoundation;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class MoorlProductAccessories extends Plugin
{
public const NAME = 'MoorlProductAccessories';
public const DATA_CREATED_AT = '2003-05-03 03:03:04.000';
public const CMS_PAGE = 'moorl_pa_accessory';
public const CMS_PAGE_ID = '9ce427efc86506801daedbf910f75bc4';
public const PLUGIN_TABLES = [
'moorl_pa_category',
'moorl_pa_category_translation',
'moorl_pa_accessory',
'moorl_pa_product_category',
];
public const SHOPWARE_TABLES = [
'media_folder',
'cms_page',
'cms_page_translation',
'cms_section',
'cms_block',
'category',
'category_translation',
'product',
'product_translation',
'product_category',
'product_visibility'
];
public function install(InstallContext $installContext): void
{
parent::install($installContext);
/* @var $foundation PluginFoundation */
$foundation = $this->container->get(PluginFoundation::class);
$foundation->setContext($installContext->getContext());
}
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
/* @var $foundation PluginFoundation */
$foundation = $this->container->get(PluginFoundation::class);
$foundation->setContext($context->getContext());
$foundation->dropTables([
'moorl_pa_accessory',
'moorl_pa_category_translation',
'moorl_pa_category'
]);
$foundation->removePluginSnippets('moorl-product-accessories');
$foundation->removePluginConfig('MoorlProductAccessories');
$foundation->removeCmsBlocks(['moorl-product-accessories-basic']);
}
}