custom/plugins/CogiCmsNewsletter/src/CogiCmsNewsletter.php line 13

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Cogi\CmsNewsletter;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Context;
  5. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  8. use Cogi\CmsNewsletter\Core\CustomFieldWizard;
  9. class CogiCmsNewsletter extends Plugin
  10. {
  11.     /**
  12.      * @param InstallContext $installContext
  13.      */
  14.     public function install(InstallContext $installContext): void
  15.     {
  16.         parent::install($installContext);
  17.     }
  18.     /**
  19.      * @param UpdateContext $installContext
  20.      */
  21.     public function update(UpdateContext $updateContext): void
  22.     {
  23.         parent::update($updateContext);
  24.     }
  25.     /**
  26.      * @param UninstallContext $uninstallContext
  27.      */
  28.     public function uninstall(UninstallContext $uninstallContext): void
  29.     {
  30.         if ($uninstallContext->keepUserData()) {
  31.             parent::uninstall($uninstallContext);
  32.             return;
  33.         }
  34. //        try {
  35. //
  36. //            $customFieldWizard = new CustomFieldWizard('cogi_cms_layouts', $this->container, $uninstallContext->getContext());
  37. //            $customFieldWizard->uninstall();
  38. //
  39. //        } catch (\Exception $e) {
  40. //            // Something went wrong
  41. //        }
  42.         parent::uninstall($uninstallContext);
  43.     }
  44. //    /**
  45. //     * @param $context Context
  46. //     */
  47. //    protected function installCustomFields(Context $context)
  48. //    {
  49. //        try {
  50. //
  51. //            $customFieldWizard = new CustomFieldWizard('cogi_cms_layouts', $this->container, $context);
  52. //
  53. //            $customFieldWizard
  54. //                ->addFieldSet(
  55. //                    'cms_block',
  56. //                    [
  57. //                        'de-DE' => 'CMS-Layouts Sondereinstellungen',
  58. //                        'en-GB' => 'CMS-Layouts additional settings'
  59. //                    ],
  60. //                    ['cms_block']
  61. //                )
  62. //                ->addField(
  63. //                    'cms_block', 'grid_gap', 'text',
  64. //                    [
  65. //                        'de-DE' => 'Abstand zwischen Kacheln',
  66. //                        'en-GB' => 'Grid gap'
  67. //                    ]
  68. //                )
  69. //                ->install();
  70. //
  71. //        } catch (\Exception $e) {
  72. //            // Something went wrong
  73. //        }
  74. //    }
  75. }