1 | <?php |
||
21 | trait TShipGroup |
||
22 | { |
||
23 | /** @var IDestination */ |
||
24 | protected $destination; |
||
25 | /** @var string */ |
||
26 | protected $shipmentMethod; |
||
27 | /** @var string */ |
||
28 | protected $shipmentMethodDisplayText; |
||
29 | |||
30 | public function getShippingDestination() |
||
34 | |||
35 | public function setShippingDestination(IDestination $destination) |
||
36 | { |
||
37 | $this->destination = $destination; |
||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | public function getShipmentMethod() |
||
45 | |||
46 | public function setShipmentMethod($method) |
||
47 | { |
||
48 | $this->shipmentMethod = $method; |
||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Text string to display for the shipment method |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getShipmentMethodDisplayText() |
||
61 | |||
62 | /** |
||
63 | * @param string |
||
64 | * @return self |
||
65 | */ |
||
66 | public function setShipmentMethodDisplayText($displayText) |
||
67 | { |
||
68 | $this->shipmentMethodDisplayText = $displayText; |
||
69 | return $this; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Get a payload instance mapped to the specified interface |
||
74 | * @param string $interface |
||
75 | * @return IPayload |
||
76 | */ |
||
77 | abstract protected function buildPayloadForInterface($interface); |
||
78 | |||
79 | /** |
||
80 | * Deserialize data not mapped by the extraction paths |
||
81 | * @return self |
||
82 | */ |
||
83 | abstract protected function deserializeExtra($serializedPayload); |
||
84 | |||
85 | /** |
||
86 | * Deserialize the destination |
||
87 | * @param DOMXPath $xpath |
||
88 | * @return self |
||
89 | */ |
||
90 | protected function deserializeShippingDestination(DOMXPath $xpath) |
||
112 | |||
113 | protected function serializeShipmentMethod() |
||
124 | } |
||
125 |