<?php declare(strict_types=1);
/**
* @copyright 2020 Crehler Sp. z o. o. <https://crehler.com>
*
* @author Jakub MedyĆski <jme@crehler.com>
* @support Crehler <support@crehler.com>
* @created 14 maj 2020
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crehler\ShoppingList;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
// SWAG-133666
if (file_exists(dirname(__DIR__) . '/CrehlerShoppingList/vendor/autoload.php')) {
require_once dirname(__DIR__) . '/CrehlerShoppingList/vendor/autoload.php';
}
class CrehlerShoppingList extends Plugin
{
public const SHOPPING_LIST_COOKIE_TOKEN_NAME = 'shopping-list-token';
public function build(ContainerBuilder $container): void
{
parent::build($container);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/DependencyInjection/'));
$loader->load('entity.xml');
$loader->load('storefront.xml');
$loader->load('service.xml');
$loader->load('document.xml');
}
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
// $connection->executeUpdate('ALTER TABLE `customer` DROP COLUMN ``');
}
}