Esempio n. 1
0
 /**
  * @param boolean $returnSXE
  * @param \SimpleXMLElement $sxe
  * @return string|\SimpleXMLElement
  */
 public function xmlSerialize($returnSXE = false, $sxe = null)
 {
     if (null === $sxe) {
         $sxe = new \SimpleXMLElement('<Money xmlns="http://hl7.org/fhir"></Money>');
     }
     parent::xmlSerialize(true, $sxe);
     if (0 < count($this->extension)) {
         foreach ($this->extension as $extension) {
             $extension->xmlSerialize(true, $sxe->addChild('extension'));
         }
     }
     if (null !== $this->value) {
         $this->value->xmlSerialize(true, $sxe->addChild('value'));
     }
     if (null !== $this->comparator) {
         $this->comparator->xmlSerialize(true, $sxe->addChild('comparator'));
     }
     if (null !== $this->unit) {
         $this->unit->xmlSerialize(true, $sxe->addChild('unit'));
     }
     if (null !== $this->system) {
         $this->system->xmlSerialize(true, $sxe->addChild('system'));
     }
     if (null !== $this->code) {
         $this->code->xmlSerialize(true, $sxe->addChild('code'));
     }
     if (null !== $this->id) {
         $idElement = $sxe->addChild('id');
         $idElement->addAttribute('value', (string) $this->id);
     }
     if ($returnSXE) {
         return $sxe;
     }
     return $sxe->saveXML();
 }
 /**
  * @param boolean $returnSXE
  * @param \SimpleXMLElement $sxe
  * @return string|\SimpleXMLElement
  */
 public function xmlSerialize($returnSXE = false, $sxe = null)
 {
     if (null === $sxe) {
         $sxe = new \SimpleXMLElement('<Quantity xmlns="http://hl7.org/fhir"></Quantity>');
     }
     parent::xmlSerialize(true, $sxe);
     if (null !== $this->value) {
         $this->value->xmlSerialize(true, $sxe->addChild('value'));
     }
     if (null !== $this->comparator) {
         $this->comparator->xmlSerialize(true, $sxe->addChild('comparator'));
     }
     if (null !== $this->unit) {
         $this->unit->xmlSerialize(true, $sxe->addChild('unit'));
     }
     if (null !== $this->system) {
         $this->system->xmlSerialize(true, $sxe->addChild('system'));
     }
     if (null !== $this->code) {
         $this->code->xmlSerialize(true, $sxe->addChild('code'));
     }
     if ($returnSXE) {
         return $sxe;
     }
     return $sxe->saveXML();
 }