1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRBundle
;
4 * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using
5 * class definitions from HL7 FHIR (https://www.hl7.org/fhir/)
7 * Class creation date: February 10th, 2018
10 use HL7\FHIR\STU3\FHIRElement\FHIRBackboneElement
;
13 * A container for a collection of resources.
15 class FHIRBundleLink
extends FHIRBackboneElement
implements \JsonSerializable
18 * A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRString
21 public $relation = null;
24 * The reference details for the link.
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRUri
32 private $_fhirElementName = 'Bundle.Link';
35 * A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
36 * @return \HL7\FHIR\STU3\FHIRElement\FHIRString
38 public function getRelation()
40 return $this->relation
;
44 * A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
45 * @param \HL7\FHIR\STU3\FHIRElement\FHIRString $relation
48 public function setRelation($relation)
50 $this->relation
= $relation;
55 * The reference details for the link.
56 * @return \HL7\FHIR\STU3\FHIRElement\FHIRUri
58 public function getUrl()
64 * The reference details for the link.
65 * @param \HL7\FHIR\STU3\FHIRElement\FHIRUri $url
68 public function setUrl($url)
77 public function get_fhirElementName()
79 return $this->_fhirElementName
;
85 public function __construct($data = [])
87 if (is_array($data)) {
88 if (isset($data['relation'])) {
89 $this->setRelation($data['relation']);
91 if (isset($data['url'])) {
92 $this->setUrl($data['url']);
94 } else if (null !== $data) {
95 throw new \
InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
97 parent
::__construct($data);
103 public function __toString()
105 return $this->get_fhirElementName();
111 public function jsonSerialize()
113 $json = parent
::jsonSerialize();
114 if (isset($this->relation
)) {
115 $json['relation'] = $this->relation
;
117 if (isset($this->url
)) {
118 $json['url'] = $this->url
;
124 * @param boolean $returnSXE
125 * @param \SimpleXMLElement $sxe
126 * @return string|\SimpleXMLElement
128 public function xmlSerialize($returnSXE = false, $sxe = null)
131 $sxe = new \
SimpleXMLElement('<BundleLink xmlns="http://hl7.org/fhir"></BundleLink>');
133 parent
::xmlSerialize(true, $sxe);
134 if (isset($this->relation
)) {
135 $this->relation
->xmlSerialize(true, $sxe->addChild('relation'));
137 if (isset($this->url
)) {
138 $this->url
->xmlSerialize(true, $sxe->addChild('url'));
143 return $sxe->saveXML();