@@ 92-103 (lines=12) @@ | ||
89 | * @throws \SimpleUPS\Api\InvalidParameterException |
|
90 | * @return Request |
|
91 | */ |
|
92 | public function setPickupType($pickupType) |
|
93 | { |
|
94 | $reflectionClass = new \ReflectionClass('SimpleUPS\Rates\PickupType'); |
|
95 | if (!in_array($pickupType, $reflectionClass->getConstants())) { |
|
96 | throw new \SimpleUPS\Api\InvalidParameterException( |
|
97 | 'PickupType is invalid, refer to SimpleUPS\Rates\PickupType for valid pickup types' |
|
98 | ); |
|
99 | } |
|
100 | ||
101 | $this->pickupType = $pickupType; |
|
102 | return $this; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * @return string |
|
@@ 128-139 (lines=12) @@ | ||
125 | * @throws \SimpleUPS\Api\InvalidParameterException |
|
126 | * @return Request |
|
127 | */ |
|
128 | public function setRateType($rateType) |
|
129 | { |
|
130 | $reflectionClass = new \ReflectionClass('SimpleUPS\Rates\RateType'); |
|
131 | if (!in_array($rateType, $reflectionClass->getConstants())) { |
|
132 | throw new \SimpleUPS\Api\InvalidParameterException( |
|
133 | 'RateType is invalid, refer to SimpleUPS\Rates\RateType for valid rate types' |
|
134 | ); |
|
135 | } |
|
136 | ||
137 | $this->rateType = $rateType; |
|
138 | return $this; |
|
139 | } |
|
140 | ||
141 | /** |
|
142 | * @return string |