예제 #1
0
 /**
  * @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;
 }
예제 #2
0
파일: Package.php 프로젝트: camigreen/ttop
 /**
  * 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;
 }