<?php declare(strict_types=1);
namespace Cbax\ModulGoogleShopping;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Cbax\ModulGoogleShopping\Bootstrap\Database;
use Cbax\ModulGoogleShopping\Bootstrap\Attributes;
use Cbax\ModulGoogleShopping\Bootstrap\Updater;
class CbaxModulGoogleShopping extends Plugin
{
public function install(InstallContext $context): void
{
// Attribut Felder anlegen
$builder = new Attributes();
$builder->install($context, $this->container);
parent::install($context);
}
public function uninstall(UninstallContext $context): void
{
if ($context->keepUserData()) {
parent::uninstall($context);
return;
}
// Attribut Felder löschen
$builder = new Attributes();
$builder->uninstall($context, $this->container);
// Datenbank Tabellen löschen
$db = new Database();
$db->removeDatabaseTables($this->container);
parent::uninstall($context);
}
public function activate(ActivateContext $context): void
{
parent::activate($context);
}
public function deactivate(DeactivateContext $context): void
{
parent::deactivate($context);
}
public function update(UpdateContext $context): void
{
$builder = new Attributes();
$builder->update($context, $this->container);
parent::update($context);
}
public function postUpdate(UpdateContext $context) : void {
$updater = new Updater();
$updater->afterUpdateSteps($context, $this->container);
}
}