<?php
declare(strict_types=1);
namespace Rapidmail\Shopware;
use Doctrine\DBAL\Connection;
use Rapidmail\Shopware\Repositories\IntegrationRepository;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class rapi1Connector extends Plugin
{
public function activate(ActivateContext $activateContext): void
{
}
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if (method_exists($context, 'keepUserData') && $context->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
$connection->executeUpdate(
'DELETE FROM `integration` WHERE label like "' . IntegrationRepository::LABEL . '%"'
);
$connection->executeUpdate('DROP TABLE IF EXISTS `deleted_entity`');
}
}