diff --git a/Events/Events.php b/Events/Events.php new file mode 100644 index 0000000..616d545 --- /dev/null +++ b/Events/Events.php @@ -0,0 +1,46 @@ +execute(" + ALTER TABLE oxmanufacturers + ADD COLUMN IF NOT EXISTS D3DESCRIPTION VARCHAR(255) NOT NULL, + ADD COLUMN IF NOT EXISTS D3DESCRIPTION_1 VARCHAR(255) NOT NULL, + ADD COLUMN IF NOT EXISTS D3DESCRIPTION_2 VARCHAR(255) NOT NULL, + ADD COLUMN IF NOT EXISTS D3DESCRIPTION_3 VARCHAR(255) NOT NULL; + "); + } catch (\Exception $e) { + if ((string)$e->getCode() === '1054') { + return true; + } + throw $e; + } + + return false; + } +} \ No newline at end of file diff --git a/metadata.php b/metadata.php index 549c183..acabe50 100644 --- a/metadata.php +++ b/metadata.php @@ -15,6 +15,7 @@ declare(strict_types=1); use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc; use D3\ManufacturerInformation\Application\Model\Constants; +use D3\ManufacturerInformation\Events\Events; use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc; use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList; use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer; @@ -49,8 +50,8 @@ $aModule = [ OEManufacturerList::class => ManufacturerInfoList::class ], 'events' => [ -// 'onActivate' => '\D3\ThisModule\Setup\Events::onActivate', -// 'onDeactivate' => '\D3\ThisModule\Setup\Events::onDeactivate', + 'onActivate' => Events::class.'::activate', + 'onDeactivate' => Events::class.'::deActivate', ], 'templates' => [ 'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',