-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAmazonReportDocumentActionData.php
108 lines (86 loc) · 2.52 KB
/
AmazonReportDocumentActionData.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
declare(strict_types=1);
/**
*
* @author xiaoguo0426
* @contact [email protected]
* @license MIT
*/
namespace App\Queue\Data;
class AmazonReportDocumentActionData extends QueueData
{
private int $merchant_id;
private int $merchant_store_id;
private string $region;
private string $marketplace_ids;
private string $report_document_id;
private string $report_type;
public function getMerchantId(): int
{
return $this->merchant_id;
}
public function setMerchantId(int $merchant_id): void
{
$this->merchant_id = $merchant_id;
}
public function getMerchantStoreId(): int
{
return $this->merchant_store_id;
}
public function setMerchantStoreId(int $merchant_store_id): void
{
$this->merchant_store_id = $merchant_store_id;
}
public function getReportDocumentId(): string
{
return $this->report_document_id;
}
public function getRegion(): string
{
return $this->region;
}
public function setRegion(string $region): void
{
$this->region = $region;
}
public function getMarketplaceIds(): array
{
return explode(',', $this->marketplace_ids);
}
public function setMarketplaceIds(array $marketplace_ids): void
{
$this->marketplace_ids = implode(',', $marketplace_ids);
}
public function setReportDocumentId(string $report_document_id): void
{
$this->report_document_id = $report_document_id;
}
public function getReportType(): string
{
return $this->report_type;
}
public function setReportType(string $report_type): void
{
$this->report_type = $report_type;
}
public function toJson(): string
{
return json_encode([
'merchant_id' => $this->merchant_id,
'merchant_store_id' => $this->merchant_store_id,
'region' => $this->region,
'marketplace_ids' => $this->marketplace_ids,
'report_document_id' => $this->report_document_id,
'report_type' => $this->report_type,
], JSON_THROW_ON_ERROR);
}
public function parse(array $arr): void
{
$this->setMerchantId($arr['merchant_id']);
$this->setMerchantStoreId($arr['merchant_store_id']);
$this->setRegion($arr['region']);
$this->setMarketplaceIds(explode(',', $arr['marketplace_ids']));
$this->setReportDocumentId($arr['report_document_id']);
$this->setReportType($arr['report_type']);
}
}