58 lines
1.7 KiB
PHP
Executable File
58 lines
1.7 KiB
PHP
Executable File
<?php declare(strict_types=1);
|
|
|
|
namespace AeonDumpManager;
|
|
|
|
use Doctrine\DBAL\Connection;
|
|
use Shopware\Core\Framework\Plugin;
|
|
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
|
|
use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
|
|
use Shopware\Core\Framework\Plugin\Context\InstallContext;
|
|
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
|
|
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
|
|
|
|
class AeonDumpManager extends Plugin
|
|
{
|
|
public function install(InstallContext $installContext): void
|
|
{
|
|
// Do stuff such as creating a new payment method
|
|
}
|
|
|
|
public function uninstall(UninstallContext $uninstallContext): void
|
|
{
|
|
parent::uninstall($uninstallContext);
|
|
|
|
if ($uninstallContext->keepUserData()) {
|
|
return;
|
|
}
|
|
|
|
/** @var Connection $connection */
|
|
$connection = $this->container->get(Connection::class);
|
|
$connection->executeStatement('DROP TABLE IF EXISTS `aeon_dump_manager_job`');
|
|
}
|
|
|
|
public function activate(ActivateContext $activateContext): void
|
|
{
|
|
// Activate entities, such as a new payment method
|
|
// Or create new entities here, because now your plugin is installed and active for sure
|
|
}
|
|
|
|
public function deactivate(DeactivateContext $deactivateContext): void
|
|
{
|
|
// Deactivate entities, such as a new payment method
|
|
// Or remove previously created entities
|
|
}
|
|
|
|
public function update(UpdateContext $updateContext): void
|
|
{
|
|
// Update necessary stuff, mostly non-database related
|
|
}
|
|
|
|
public function postInstall(InstallContext $installContext): void
|
|
{
|
|
}
|
|
|
|
public function postUpdate(UpdateContext $updateContext): void
|
|
{
|
|
}
|
|
}
|