1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\PakkelabelsBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* This entity maps any (shipping method) string to a product code and optional service codes |
9
|
|
|
* |
10
|
|
|
* @ORM\Entity |
11
|
|
|
* @ORM\Table(name="pakkelabels_shipping_method_mapping") |
12
|
|
|
*/ |
13
|
|
|
class ShippingMethodMapping |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var int |
17
|
|
|
* |
18
|
|
|
* @ORM\Id |
19
|
|
|
* @ORM\GeneratedValue |
20
|
|
|
* @ORM\Column(type="integer") |
21
|
|
|
*/ |
22
|
|
|
protected $id; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
* |
27
|
|
|
* @ORM\Column(type="string", unique=true) |
28
|
|
|
*/ |
29
|
|
|
protected $source; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var string |
33
|
|
|
* |
34
|
|
|
* @ORM\Column(type="string") |
35
|
|
|
*/ |
36
|
|
|
protected $productCode; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var array |
40
|
|
|
* |
41
|
|
|
* @ORM\Column(type="array", nullable=true) |
42
|
|
|
*/ |
43
|
|
|
protected $serviceCodes; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @return int |
47
|
|
|
*/ |
48
|
|
|
public function getId(): int |
49
|
|
|
{ |
50
|
|
|
return $this->id; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @param int $id |
55
|
|
|
* @return ShippingMethodMapping |
56
|
|
|
*/ |
57
|
|
|
public function setId(int $id) |
58
|
|
|
{ |
59
|
|
|
$this->id = $id; |
60
|
|
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getSource(): string |
67
|
|
|
{ |
68
|
|
|
return $this->source; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param string $source |
73
|
|
|
* @return ShippingMethodMapping |
74
|
|
|
*/ |
75
|
|
|
public function setSource(string $source) |
76
|
|
|
{ |
77
|
|
|
$this->source = $source; |
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getProductCode(): string |
85
|
|
|
{ |
86
|
|
|
return $this->productCode; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param string $productCode |
91
|
|
|
* @return ShippingMethodMapping |
92
|
|
|
*/ |
93
|
|
|
public function setProductCode(string $productCode) |
94
|
|
|
{ |
95
|
|
|
$this->productCode = $productCode; |
96
|
|
|
return $this; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return array |
101
|
|
|
*/ |
102
|
|
|
public function getServiceCodes(): array |
103
|
|
|
{ |
104
|
|
|
return $this->serviceCodes; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param array $serviceCodes |
109
|
|
|
* @return ShippingMethodMapping |
110
|
|
|
*/ |
111
|
|
|
public function setServiceCodes(array $serviceCodes) |
112
|
|
|
{ |
113
|
|
|
$this->serviceCodes = $serviceCodes; |
114
|
|
|
return $this; |
115
|
|
|
} |
116
|
|
|
} |
117
|
|
|
|