1: <?php
2: namespace Datadepo\Api\Structures;
3:
4: /**
5: * @property-read string $state
6: * @property-read \DateTime $upcomingDate
7: * @property-read integer $count
8: * @property-read array $note
9: * @property-read integer $availability
10: * @property-read string $availabilityText
11: * @property-read integer $availabilityMin
12: * @property-read integer $availabilityMax
13: */
14: class StoreLine extends AbstractStructure
15: {
16:
17: /**
18: * @param array $data
19: */
20: public function __construct($data)
21: {
22: $this->data = $data;
23: }
24:
25: /**
26: * @return string
27: */
28: public function getJson()
29: {
30: return json_encode($this->data);
31: }
32:
33: /**
34: * @return string
35: */
36: public function getState()
37: {
38: return $this->data->state;
39: }
40:
41: /**
42: * @return string
43: */
44: public function getUpcomingDate()
45: {
46: return $this->data->upcomingDate !== NULL ? new \DateTime($this->data->upcomingDate) : NULL;
47: }
48:
49: /**
50: * @return string
51: */
52: public function getCount()
53: {
54: return $this->data->count;
55: }
56:
57: /**
58: * @return string
59: */
60: public function getNote()
61: {
62: return $this->data->note !== NULL ? json_decode($this->data->note) : NULL;
63: }
64:
65: /**
66: * @return string
67: */
68: public function getAvailability()
69: {
70: return $this->data->availability;
71: }
72:
73: /**
74: * @return string
75: */
76: public function getAvailabilityText()
77: {
78: return $this->data->availabilityText;
79: }
80:
81: /**
82: * @return string
83: */
84: public function getAvailabilityMin()
85: {
86: return $this->data->availabilityMin;
87: }
88:
89: /**
90: * @return string
91: */
92: public function getAvailabilityMax()
93: {
94: return $this->data->availabilityMax;
95: }
96:
97:
98: }