1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Lamoda\IsmpClient\V3\Dto\FacadeDocBodyResponse; |
6
|
|
|
|
7
|
|
|
use Lamoda\IsmpClient\V3\Dto\FacadeDocBodyResponse\Body\DocumentDescription; |
8
|
|
|
use Lamoda\IsmpClient\V3\Dto\FacadeDocBodyResponse\Body\Products\Product; |
9
|
|
|
|
10
|
|
|
class Body |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var string |
14
|
|
|
*/ |
15
|
|
|
private $originalString; |
16
|
|
|
/** |
17
|
|
|
* @var string |
18
|
|
|
*/ |
19
|
|
|
private $regDate; |
20
|
|
|
/** |
21
|
|
|
* @var DocumentDescription |
22
|
|
|
*/ |
23
|
|
|
private $documentDescription; |
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
private $docType; |
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
private $receiver; |
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
private $docId; |
36
|
|
|
/** |
37
|
|
|
* @var Product[] |
38
|
|
|
*/ |
39
|
|
|
private $products = []; |
40
|
|
|
|
41
|
|
|
public function getOriginalString(): string |
42
|
|
|
{ |
43
|
|
|
return $this->originalString; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function setOriginalString(string $originalString): self |
47
|
|
|
{ |
48
|
|
|
$this->originalString = $originalString; |
49
|
|
|
|
50
|
|
|
return $this; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function getRegDate(): string |
54
|
|
|
{ |
55
|
|
|
return $this->regDate; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function setRegDate(string $regDate): self |
59
|
|
|
{ |
60
|
|
|
$this->regDate = $regDate; |
61
|
|
|
|
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getDocumentDescription(): DocumentDescription |
66
|
|
|
{ |
67
|
|
|
return $this->documentDescription; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function setDocumentDescription(DocumentDescription $documentDescription): self |
71
|
|
|
{ |
72
|
|
|
$this->documentDescription = $documentDescription; |
73
|
|
|
|
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getDocType(): string |
78
|
|
|
{ |
79
|
|
|
return $this->docType; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function setDocType(string $docType): self |
83
|
|
|
{ |
84
|
|
|
$this->docType = $docType; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getReceiver(): string |
90
|
|
|
{ |
91
|
|
|
return $this->receiver; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setReceiver(string $receiver): self |
95
|
|
|
{ |
96
|
|
|
$this->receiver = $receiver; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function getDocId(): string |
102
|
|
|
{ |
103
|
|
|
return $this->docId; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function setDocId(string $docId): self |
107
|
|
|
{ |
108
|
|
|
$this->docId = $docId; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @return Product[] |
115
|
|
|
*/ |
116
|
|
|
public function getProducts(): array |
117
|
|
|
{ |
118
|
|
|
return $this->products; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
public function addProduct(Product $product): self |
122
|
|
|
{ |
123
|
|
|
$this->products[spl_object_hash($product)] = $product; |
124
|
|
|
|
125
|
|
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function removeProduct(Product $product): self |
129
|
|
|
{ |
130
|
|
|
unset($this->products[spl_object_hash($product)]); |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
public function hasProducts(Product $product): bool |
136
|
|
|
{ |
137
|
|
|
return array_key_exists(spl_object_hash($product), $this->products); |
138
|
|
|
} |
139
|
|
|
} |
140
|
|
|
|