|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / app / code / Amasty / ShippingTableRates / Setup / |
Filename | /home/a/home/dev2.destoffenstraat.com/app/code/Amasty/ShippingTableRates/Setup/Uninstall.php |
Size | 2.05 kb |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 18-May-2023 11:20 |
Last accessed | 22-Aug-2025 20:57 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Shipping Table Rates for Magento 2
*/
namespace Amasty\ShippingTableRates\Setup;
use Amasty\ShippingTableRates\Model\ResourceModel\Label;
use Amasty\ShippingTableRates\Model\ResourceModel\Method;
use Amasty\ShippingTableRates\Model\ResourceModel\Rate;
use Magento\Catalog\Model\Product;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UninstallInterface;
class Uninstall implements UninstallInterface
{
public const AM_SHIPPING_TYPE = 'am_shipping_type';
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
/**
* @var EavSetupFactory
*/
private $eavSetupFactory;
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
EavSetupFactory $eavSetupFactory
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->eavSetupFactory = $eavSetupFactory;
}
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context): void
{
$setup->getConnection()
->dropTable($setup->getTable(Label::MAIN_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::SOURCES_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::MAIN_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::MAIN_TABLE . '_replica'));
$setup->getConnection()
->dropTable($setup->getTable(Method::MAIN_TABLE));
/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
if ($eavSetup->getAttribute(Product::ENTITY, self::AM_SHIPPING_TYPE)) {
$eavSetup->removeAttribute(Product::ENTITY, self::AM_SHIPPING_TYPE);
}
}
}
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Shipping Table Rates for Magento 2
*/
namespace Amasty\ShippingTableRates\Setup;
use Amasty\ShippingTableRates\Model\ResourceModel\Label;
use Amasty\ShippingTableRates\Model\ResourceModel\Method;
use Amasty\ShippingTableRates\Model\ResourceModel\Rate;
use Magento\Catalog\Model\Product;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UninstallInterface;
class Uninstall implements UninstallInterface
{
public const AM_SHIPPING_TYPE = 'am_shipping_type';
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
/**
* @var EavSetupFactory
*/
private $eavSetupFactory;
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
EavSetupFactory $eavSetupFactory
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->eavSetupFactory = $eavSetupFactory;
}
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context): void
{
$setup->getConnection()
->dropTable($setup->getTable(Label::MAIN_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::SOURCES_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::MAIN_TABLE));
$setup->getConnection()
->dropTable($setup->getTable(Rate::MAIN_TABLE . '_replica'));
$setup->getConnection()
->dropTable($setup->getTable(Method::MAIN_TABLE));
/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
if ($eavSetup->getAttribute(Product::ENTITY, self::AM_SHIPPING_TYPE)) {
$eavSetup->removeAttribute(Product::ENTITY, self::AM_SHIPPING_TYPE);
}
}
}