1 | <?php |
||
9 | class Item |
||
10 | { |
||
11 | /** |
||
12 | * @var string The transaction ID. This ID is what links items to the transactions to which they belong. (e.g. 1234) |
||
13 | */ |
||
14 | protected $transactionId; |
||
15 | |||
16 | /** |
||
17 | * @var string The item name. (e.g. Fluffy Pink Bunnies) |
||
18 | */ |
||
19 | protected $name; |
||
20 | |||
21 | /** |
||
22 | * @var string Specifies the SKU or item code. (e.g. SKU47) |
||
23 | */ |
||
24 | protected $sku; |
||
25 | |||
26 | /** |
||
27 | * @var string The category to which the item belongs (e.g. Party Toys) |
||
28 | */ |
||
29 | protected $category; |
||
30 | |||
31 | /** |
||
32 | * @var float The individual, unit, price for each item. (e.g. 11.99) |
||
33 | */ |
||
34 | protected $price; |
||
35 | |||
36 | /** |
||
37 | * @var int The number of units purchased in the transaction. |
||
38 | * If a non-integer value is passed into this field (e.g. 1.5), it will be rounded to the closest integer value. |
||
39 | */ |
||
40 | protected $quantity; |
||
41 | |||
42 | /** |
||
43 | * @param $params |
||
44 | * @return static |
||
45 | */ |
||
46 | public static function createFromArray($params) |
||
52 | |||
53 | /** |
||
54 | * @param $params |
||
55 | */ |
||
56 | public function populateFromParams($params) |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getTransactionId(): string |
||
72 | |||
73 | /** |
||
74 | * @param string $transactionId |
||
75 | */ |
||
76 | public function setTransactionId(string $transactionId) |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getName(): string |
||
88 | |||
89 | /** |
||
90 | * @param string $name |
||
91 | */ |
||
92 | public function setName(string $name) |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getSku() |
||
104 | |||
105 | /** |
||
106 | * @param string $sku |
||
107 | */ |
||
108 | public function setSku(string $sku) |
||
112 | |||
113 | /** |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getCategory() |
||
120 | |||
121 | /** |
||
122 | * @param string $category |
||
123 | */ |
||
124 | public function setCategory(string $category) |
||
128 | |||
129 | /** |
||
130 | * @return float |
||
131 | */ |
||
132 | public function getPrice() |
||
136 | |||
137 | /** |
||
138 | * @param float $price |
||
139 | */ |
||
140 | public function setPrice(float $price) |
||
144 | |||
145 | /** |
||
146 | * @return int |
||
147 | */ |
||
148 | public function getQuantity() |
||
152 | |||
153 | /** |
||
154 | * @param int $quantity |
||
155 | */ |
||
156 | public function setQuantity(int $quantity) |
||
160 | } |
||
161 |