code; } /** * @param string $code */ public function setCode($code) { $this->code = $code; } /** * @return string|null */ public function getValue() { return $this->value; } /** * @param string $value */ public function setValue($value) { $this->value = $value; } /** * @return bool */ public function getBarCodeIndicator() { return $this->barCodeIndicator; } /** * @param bool $barCodeIndicator */ public function setBarCodeIndicator($barCodeIndicator) { $this->barCodeIndicator = $barCodeIndicator; } /** * @param null $response */ public function __construct($response = null) { if (null !== $response) { if (isset($response->BarCodeIndicator)) { $this->setBarCodeIndicator($response->BarCodeIndicator); } if (isset($response->Code)) { $this->setCode($response->Code); } if (isset($response->Value)) { $this->setValue($response->Value); } } } /** * @param null|DOMDocument $document * * @return DOMElement */ public function toNode(DOMDocument $document = null) { if (null === $document) { $document = new DOMDocument(); } $node = $document->createElement('ReferenceNumber'); if ($this->getBarCodeIndicator()) { $node->appendChild($document->createElement('BarCodeIndicator')); } $node->appendChild($document->createElement('Code', $this->getCode())); $node->appendChild($document->createElement('Value', $this->getValue())); return $node; } }