-
Notifications
You must be signed in to change notification settings - Fork 5
/
OrderCreationConfiguration.php
52 lines (44 loc) · 1.33 KB
/
OrderCreationConfiguration.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
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Created by PhpStorm.
* User: audreymartel
* Date: 27/07/2018
* Time: 16:27
*/
namespace OrderCreation;
class OrderCreationConfiguration
{
const CONFIG_KEY_DELIVERY_MODULE_ID = 'order_creation_delivery_module_id';
const SOCOLISSIMO_MODE = 'order_creation_socolissimo_mode';
const LIST_PAYMENT_MODULE = 'order_creation_list_payment_module';
/**
* @param $moduleId integer | null
*/
public static function setDeliveryModuleId($moduleId)
{
OrderCreation::setConfigValue(self::CONFIG_KEY_DELIVERY_MODULE_ID, $moduleId);
}
public static function setSoColissimoMode($mode)
{
OrderCreation::setConfigValue(self::SOCOLISSIMO_MODE, $mode);
}
public static function setlistPaymentModule($list)
{
OrderCreation::setConfigValue(self::LIST_PAYMENT_MODULE, json_encode($list));
}
public static function getSoColissimoMode()
{
return OrderCreation::getConfigValue(self::SOCOLISSIMO_MODE, null);
}
public static function getlistPaymentModule()
{
return OrderCreation::getConfigValue(self::LIST_PAYMENT_MODULE, json_encode([]));
}
/**
* @return integer | null
*/
public static function getDeliveryModuleId()
{
return OrderCreation::getConfigValue(self::CONFIG_KEY_DELIVERY_MODULE_ID, null);
}
}