/** * @internal * * @param \SimpleXMLElement $xml * * @return Weight */ public static function fromXml(\SimpleXMLElement $xml) { $pso = new PackageServiceOptions(); $pso->setIsResponse(); $pso->setDeclaredValue($xml->DeclaredValue->MonetaryValue, $xml->DeclaredValue->CurrencyCode); return $pso; }
/** * Set the declared value of this package * * @param Float|MonetaryValue $value * * @param string|Currency Code $code * * @return Package */ public function setDeclaredValue($value, $code = null) { if (is_object($this->PackageServiceOptions)) { $pso = $this->PackageServiceOptions; } else { $pso = new PackageServiceOptions(); } $pso->setDeclaredValue($value, $code); $this->PackageServiceOptions = $pso; return $this; }