1 | <?php |
||
12 | class WebhookTracks |
||
13 | { |
||
14 | use ReadableAttributes { |
||
15 | // tracks object properties |
||
16 | mayHaveAsString as public getCarrier; |
||
17 | mayHaveAsString as public getTrackingNumber; |
||
18 | mayHaveAsString as public getEta; |
||
19 | // transaction object properties |
||
20 | mayHaveAsString as public getObjectState; |
||
21 | mayHaveAsString as public getObjectStatus; |
||
22 | mayHaveAsString as public getObjectId; |
||
23 | mayHaveAsString as public getObjectOwner; |
||
24 | mayHaveAsString as public getLabelUrl; |
||
25 | mayHaveAsString as public getTrackingUrlProvider; |
||
26 | mayHaveAsString as public getCommercialInvoiceUrl; |
||
27 | mayHaveAsString as public getCustomsNote; |
||
28 | mayHaveAsString as public getSubmissionNote; |
||
29 | mayHaveAsString as public getMetadata; |
||
30 | mayHaveAsArray as public getMessages; |
||
31 | // common properties |
||
32 | mayHaveAsString as public getTrackingNumber; |
||
33 | toArray as public __toArray; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * transaction object property |
||
38 | * |
||
39 | * @return \DateTime |
||
40 | */ |
||
41 | public function getObjectCreated() |
||
45 | |||
46 | /** |
||
47 | * transaction object property |
||
48 | * |
||
49 | * @return \DateTime |
||
50 | */ |
||
51 | public function getObjectUpdated() |
||
55 | |||
56 | /** |
||
57 | * tracks object property |
||
58 | * |
||
59 | * @return \ShippoClient\Entity\Location |
||
60 | */ |
||
61 | public function getAddressFrom() |
||
67 | |||
68 | /** |
||
69 | * tracks object property |
||
70 | * |
||
71 | * @return \ShippoClient\Entity\Location |
||
72 | */ |
||
73 | public function getAddressTo() |
||
79 | |||
80 | /** |
||
81 | * tracks object property |
||
82 | * |
||
83 | * @return \ShippoClient\Entity\ServiceLevel |
||
84 | */ |
||
85 | public function getServiceLevel() |
||
91 | |||
92 | /** |
||
93 | * common property |
||
94 | * |
||
95 | * @return \ShippoClient\Entity\TrackingStatus |
||
96 | */ |
||
97 | public function getTrackingStatus() |
||
101 | |||
102 | /** |
||
103 | * common property |
||
104 | * |
||
105 | * @return \ShippoClient\Entity\TrackingHistory |
||
106 | */ |
||
107 | public function getTrackingHistory() |
||
114 | |||
115 | public function toArray() |
||
143 | } |
||
144 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: