handleError(new Exception(sprintf("Shipping adjustment type '%s' not supported", $type))); } $this->type = $type; $this->value = floatval($value); $this->ruleId = $ruleId; $this->shippingMethod = self::DEFAULT_SHIPPING_METHOD; } /** * @return string */ public function getType() { return $this->type; } /** * @param string $type * * @return bool */ public function isType($type) { return $this->type === $type; } /** * @param string $shippingMethod */ public function setMethod($shippingMethod) { $this->shippingMethod = strval($shippingMethod); } /** * @return string */ public function getMethod() { return $this->shippingMethod; } /** * @param string $methodId * * @return bool */ public function isMethod($methodId) { return $this->shippingMethod === strval($methodId); } /** * @param float $value */ public function setValue($value) { $this->value = floatval($value); } /** * @return float */ public function getValue() { return $this->value; } /** * @return int */ public function getRuleId() { return $this->ruleId; } public function setAmount($amount) { $this->amount = floatval($amount); } /** * @return float|null */ public function getAmount() { return $this->amount; } }