1 | <?php |
||
11 | class Deal implements DealInterface |
||
12 | { |
||
13 | /** |
||
14 | * @see http://allegro.pl/webapi/documentation.php/show/id,742#method-output |
||
15 | */ |
||
16 | const EVENT_TYPE_CREATE_DEAL = 1; |
||
17 | const EVENT_TYPE_CREATE_POST_SALE_FORM = 2; |
||
18 | const EVENT_TYPE_ABORT_POST_SALE_FORM = 3; |
||
19 | const EVENT_TYPE_FINISH_DEAL = 4; |
||
20 | |||
21 | protected $eventId = null; |
||
22 | |||
23 | protected $eventType = null; |
||
24 | |||
25 | protected $eventTime = null; |
||
26 | |||
27 | protected $id = null; |
||
28 | |||
29 | protected $transactionId = null; |
||
30 | |||
31 | protected $sellerId = null; |
||
32 | |||
33 | protected $itemId = null; |
||
34 | |||
35 | protected $buyerId = null; |
||
36 | |||
37 | protected $quantity = null; |
||
38 | |||
39 | |||
40 | 7 | public function __construct(stdClass $deal) |
|
44 | |||
45 | |||
46 | /** |
||
47 | * Validate and set a Deal property based on WebAPI's returned object property |
||
48 | * @param string $originalProperty original (WebAPI) property name (i.e. dealEventId) |
||
49 | * @param string $value value |
||
50 | */ |
||
51 | 7 | protected function setProperty($originalProperty, $value) |
|
67 | |||
68 | |||
69 | /** |
||
70 | * Set properties based on WebAPI's returned object |
||
71 | * @param stdClass $deal deal object returned by doGetSiteJournalDeals() |
||
72 | */ |
||
73 | 7 | protected function mapFromObject(stdClass $deal) |
|
79 | |||
80 | |||
81 | 1 | public function getEventId() |
|
85 | |||
86 | |||
87 | 1 | public function getEventType() |
|
91 | |||
92 | |||
93 | 1 | public function getEventTime($dateFormat = 'Y-m-d H:i:s') |
|
97 | |||
98 | |||
99 | 1 | public function getId() |
|
103 | |||
104 | |||
105 | 1 | public function getTransactionId() |
|
109 | |||
110 | |||
111 | 1 | public function getSellerId() |
|
115 | |||
116 | |||
117 | 1 | public function getItemId() |
|
121 | |||
122 | |||
123 | 1 | public function getBuyerId() |
|
127 | |||
128 | |||
129 | 1 | public function getQuantity() |
|
133 | |||
134 | |||
135 | 1 | public function isTypeCreateDeal() |
|
139 | |||
140 | 1 | public function isTypeCreatePostSaleForm() |
|
144 | |||
145 | 1 | public function isTypeAbortPostSaleForm() |
|
149 | |||
150 | 1 | public function isTypeFinishDeal() |
|
154 | |||
155 | |||
156 | } |
||
157 |