<?php declare(strict_types=1);
namespace Cogi\CmsNewsletter;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Cogi\CmsNewsletter\Core\CustomFieldWizard;
class CogiCmsNewsletter extends Plugin
{
/**
* @param InstallContext $installContext
*/
public function install(InstallContext $installContext): void
{
parent::install($installContext);
}
/**
* @param UpdateContext $installContext
*/
public function update(UpdateContext $updateContext): void
{
parent::update($updateContext);
}
/**
* @param UninstallContext $uninstallContext
*/
public function uninstall(UninstallContext $uninstallContext): void
{
if ($uninstallContext->keepUserData()) {
parent::uninstall($uninstallContext);
return;
}
// try {
//
// $customFieldWizard = new CustomFieldWizard('cogi_cms_layouts', $this->container, $uninstallContext->getContext());
// $customFieldWizard->uninstall();
//
// } catch (\Exception $e) {
// // Something went wrong
// }
parent::uninstall($uninstallContext);
}
// /**
// * @param $context Context
// */
// protected function installCustomFields(Context $context)
// {
// try {
//
// $customFieldWizard = new CustomFieldWizard('cogi_cms_layouts', $this->container, $context);
//
// $customFieldWizard
// ->addFieldSet(
// 'cms_block',
// [
// 'de-DE' => 'CMS-Layouts Sondereinstellungen',
// 'en-GB' => 'CMS-Layouts additional settings'
// ],
// ['cms_block']
// )
// ->addField(
// 'cms_block', 'grid_gap', 'text',
// [
// 'de-DE' => 'Abstand zwischen Kacheln',
// 'en-GB' => 'Grid gap'
// ]
// )
// ->install();
//
// } catch (\Exception $e) {
// // Something went wrong
// }
// }
}