/** * Return the object as an array for usage in the XML * * @param \DomDocument $document * @param string $prefix * @param string $type * @return \DomElement */ public function toXML(\DOMDocument $document, $prefix = null, $type = null) { $tagName = 'nationalBox'; if ($prefix !== null) { $tagName = $prefix . ':' . $tagName; } $nationalElement = $document->createElement($tagName); $boxElement = parent::toXML($document, null, 'at24-7'); $nationalElement->appendChild($boxElement); if ($this->getParcelsDepotId() !== null) { $tagName = 'parcelsDepotId'; $boxElement->appendChild($document->createElement($tagName, $this->getParcelsDepotId())); } if ($this->getParcelsDepotName() !== null) { $tagName = 'parcelsDepotName'; $boxElement->appendChild($document->createElement($tagName, $this->getParcelsDepotName())); } if ($this->getParcelsDepotAddress() !== null) { $boxElement->appendChild($this->getParcelsDepotAddress()->toXML($document)); } if ($this->getMemberId() !== null) { $tagName = 'memberId'; $boxElement->appendChild($document->createElement($tagName, $this->getMemberId())); } if ($this->getReceiverName() !== null) { $tagName = 'receiverName'; $boxElement->appendChild($document->createElement($tagName, $this->getReceiverName())); } if ($this->getReceiverCompany() !== null) { $tagName = 'receiverCompany'; $boxElement->appendChild($document->createElement($tagName, $this->getReceiverCompany())); } return $nationalElement; }
/** * Return the object as an array for usage in the XML * * @param \DomDocument $document * @param string $prefix * @param string $type * @return \DomElement */ public function toXML(\DOMDocument $document, $prefix = null, $type = null) { $tagName = 'nationalBox'; if ($prefix !== null) { $tagName = $prefix . ':' . $tagName; } $nationalElement = $document->createElement($tagName); $boxElement = parent::toXML($document, null, 'atHome'); $nationalElement->appendChild($boxElement); $openingHours = $this->getOpeningHours(); if (!empty($openingHours)) { $openingHoursElement = $document->createElement('openingHours'); foreach ($openingHours as $day) { /** @var $day \TijsVerkoyen\Bpost\Bpost\Order\Box\Openinghour\Day */ $openingHoursElement->appendChild($day->toXML($document)); } $boxElement->appendChild($openingHoursElement); } if ($this->getDesiredDeliveryPlace() !== null) { $tagName = 'desiredDeliveryPlace'; if ($prefix !== null) { $tagName = $prefix . ':' . $tagName; } $boxElement->appendChild($document->createElement($tagName, $this->getDesiredDeliveryPlace())); } if ($this->getReceiver() !== null) { $boxElement->appendChild($this->getReceiver()->toXML($document)); } return $nationalElement; }
/** * Return the object as an array for usage in the XML * * @param \DomDocument $document * @param string $prefix * @param string $type * @return \DomElement */ public function toXML(\DOMDocument $document, $prefix = null, $type = null) { $tagName = 'nationalBox'; if ($prefix !== null) { $tagName = $prefix . ':' . $tagName; } $nationalElement = $document->createElement($tagName); $boxElement = parent::toXML($document, null, 'atBpost'); $nationalElement->appendChild($boxElement); if ($this->getPugoId() !== null) { $tagName = 'pugoId'; $boxElement->appendChild($document->createElement($tagName, $this->getPugoId())); } if ($this->getPugoName() !== null) { $tagName = 'pugoName'; $boxElement->appendChild($document->createElement($tagName, $this->getPugoName())); } if ($this->getPugoAddress() !== null) { $boxElement->appendChild($this->getPugoAddress()->toXML($document, 'common')); } if ($this->getReceiverName() !== null) { $tagName = 'receiverName'; $boxElement->appendChild($document->createElement($tagName, $this->getReceiverName())); } if ($this->getReceiverCompany() !== null) { $tagName = 'receiverCompany'; $boxElement->appendChild($document->createElement($tagName, $this->getReceiverCompany())); } return $nationalElement; }
/** * Tests the methods that are implemented by the childs * But we would like to have full coverage... Stats-p**n! */ public function testMethodsThatAreImplementedByChilds() { $possibleProductValues = National::getPossibleProductValues(); $this->assertInternalType('array', $possibleProductValues); $this->assertEmpty($possibleProductValues); }