-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUninstall.php
40 lines (34 loc) · 1.13 KB
/
Uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @copyright Copyright (c) 2019, WEXO A/S
*/
namespace Partner\Module\Setup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UninstallInterface;
use Magento\Sales\Model\Order;
use Partner\Module\Model\Attributes;
class Uninstall implements UninstallInterface
{
private $eavSetupFactory;
/**
* Uninstall constructor.
* @param EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
}
/**
* @param SchemaSetupInterface $setup
* @param ModuleContextInterface $context
*/
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->removeAttribute(Order::ENTITY, Attributes::USER_IP);
$eavSetup->removeAttribute(Order::ENTITY, Attributes::PARTNER_ID);
$eavSetup->removeAttribute(Order::ENTITY, Attributes::ORDER_SENT);
}
}