Example #1
0
 /**
  * Writes the contents of this Field to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->type) {
         $writer->writeAttribute('type', $this->type);
     }
     parent::writeXmlContents($writer);
     if ($this->values) {
         foreach ($this->values as $i => $x) {
             $writer->startElementNs('gx', 'value', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #2
0
 /**
  * Writes the contents of this FieldDescriptor to an XML writer. The startElement is expected to be already
  * provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->originalLabel) {
         $writer->startElementNs('gx', 'originalLabel', null);
         $writer->text($this->originalLabel);
         $writer->endElement();
     }
     if ($this->description) {
         foreach ($this->description as $i => $x) {
             $writer->startElementNs('gx', 'description', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->values) {
         foreach ($this->values as $i => $x) {
             $writer->startElementNs('gx', 'value', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #3
0
 /**
  * Writes the contents of this EvidenceReference to an XML writer. The startElement is expected to be already
  * provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->resourceId) {
         $writer->writeAttribute('resourceId', $this->resourceId);
     }
     if ($this->resource) {
         $writer->writeAttribute('resource', $this->resource);
     }
     parent::writeXmlContents($writer);
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
 }
Example #4
0
 /**
  * Writes the contents of this Agent to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->accounts) {
         foreach ($this->accounts as $i => $x) {
             $writer->startElementNs('gx', 'account', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->addresses) {
         foreach ($this->addresses as $i => $x) {
             $writer->startElementNs('gx', 'address', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->emails) {
         foreach ($this->emails as $i => $x) {
             $writer->startElementNs('gx', 'email', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->homepage) {
         $writer->startElementNs('gx', 'homepage', null);
         $this->homepage->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->identifiers) {
         foreach ($this->identifiers as $i => $x) {
             $writer->startElementNs('gx', 'identifier', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->names) {
         foreach ($this->names as $i => $x) {
             $writer->startElementNs('gx', 'name', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->openid) {
         $writer->startElementNs('gx', 'openid', null);
         $this->openid->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->phones) {
         foreach ($this->phones as $i => $x) {
             $writer->startElementNs('gx', 'phone', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #5
0
 /**
  * Writes the contents of this Coverage to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->recordType) {
         $writer->startElementNs('gx', 'recordType', null);
         $writer->text($this->recordType);
         $writer->endElement();
     }
     if ($this->spatial) {
         $writer->startElementNs('gx', 'spatial', null);
         $this->spatial->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->temporal) {
         $writer->startElementNs('gx', 'temporal', null);
         $this->temporal->writeXmlContents($writer);
         $writer->endElement();
     }
 }
Example #6
0
 /**
  * Writes the contents of this CollectionContent to an XML writer. The startElement is expected to be already
  * provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->completeness) {
         $writer->startElementNs('gx', 'completeness', null);
         $writer->text($this->completeness);
         $writer->endElement();
     }
     if ($this->count) {
         $writer->startElementNs('gx', 'count', null);
         $writer->text($this->count);
         $writer->endElement();
     }
     if ($this->resourceType) {
         $writer->startElementNs('gx', 'resourceType', null);
         $writer->text($this->resourceType);
         $writer->endElement();
     }
 }
Example #7
0
 /**
  * Writes the contents of this SourceReference to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->descriptionRef) {
         $writer->writeAttribute('description', $this->descriptionRef);
     }
     parent::writeXmlContents($writer);
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->qualifiers) {
         foreach ($this->qualifiers as $i => $x) {
             $writer->startElementNs('gx', 'qualifier', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #8
0
 /**
  * @param \Gedcomx\Common\ExtensibleData $discussion
  */
 public function embed(ExtensibleData $discussion)
 {
     $comments = $discussion->getComments();
     if ($comments != null) {
         foreach ($comments as $comment) {
             $found = false;
             if ($comment->getId() != null) {
                 if ($this->getComments() != null) {
                     foreach ($this->getComments() as $target) {
                         if ($comment->getId() == $target->getId()) {
                             $target->embed($comment);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addComment($comment);
             }
         }
     }
     parent::embed($discussion);
 }
Example #9
0
 /**
  * Writes the contents of this Note to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->lang) {
         $writer->writeAttribute('xml:lang', $this->lang);
     }
     parent::writeXmlContents($writer);
     if ($this->subject) {
         $writer->startElementNs('gx', 'subject', null);
         $writer->text($this->subject);
         $writer->endElement();
     }
     if ($this->text) {
         $writer->startElementNs('gx', 'text', null);
         $writer->text($this->text);
         $writer->endElement();
     }
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
 }
 /**
  * Writes the contents of this FieldValueDescriptor to an XML writer. The startElement is expected to be already
  * provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->optional) {
         $writer->writeAttribute('optional', $this->optional);
     }
     if ($this->type) {
         $writer->writeAttribute('type', $this->type);
     }
     if ($this->labelId) {
         $writer->writeAttribute('labelId', $this->labelId);
     }
     parent::writeXmlContents($writer);
     if ($this->displayLabels) {
         foreach ($this->displayLabels as $i => $x) {
             $writer->startElementNs('gx', 'label', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #11
0
 /**
  * Writes the contents of this RecordSet to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->lang) {
         $writer->writeAttribute('xml:lang', $this->lang);
     }
     parent::writeXmlContents($writer);
     if ($this->metadata) {
         $writer->startElementNs('gx', 'metadata', null);
         $this->metadata->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->records) {
         foreach ($this->records as $i => $x) {
             $writer->startElementNs('gx', 'record', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #12
0
 /**
  * Writes the contents of this User to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->alternateEmail) {
         $writer->startElementNs('fs', 'alternateEmail', null);
         $writer->text($this->alternateEmail);
         $writer->endElement();
     }
     if ($this->birthDate) {
         $writer->startElementNs('fs', 'birthDate', null);
         $writer->text($this->birthDate);
         $writer->endElement();
     }
     if ($this->contactName) {
         $writer->startElementNs('fs', 'contactName', null);
         $writer->text($this->contactName);
         $writer->endElement();
     }
     if ($this->country) {
         $writer->startElementNs('fs', 'country', null);
         $writer->text($this->country);
         $writer->endElement();
     }
     if ($this->displayName) {
         $writer->startElementNs('fs', 'displayName', null);
         $writer->text($this->displayName);
         $writer->endElement();
     }
     if ($this->email) {
         $writer->startElementNs('fs', 'email', null);
         $writer->text($this->email);
         $writer->endElement();
     }
     if ($this->familyName) {
         $writer->startElementNs('fs', 'familyName', null);
         $writer->text($this->familyName);
         $writer->endElement();
     }
     if ($this->fullName) {
         $writer->startElementNs('fs', 'fullName', null);
         $writer->text($this->fullName);
         $writer->endElement();
     }
     if ($this->gender) {
         $writer->startElementNs('fs', 'gender', null);
         $writer->text($this->gender);
         $writer->endElement();
     }
     if ($this->givenName) {
         $writer->startElementNs('fs', 'givenName', null);
         $writer->text($this->givenName);
         $writer->endElement();
     }
     if ($this->helperAccessPin) {
         $writer->startElementNs('fs', 'helperAccessPin', null);
         $writer->text($this->helperAccessPin);
         $writer->endElement();
     }
     if ($this->ldsMemberAccount) {
         $writer->startElementNs('fs', 'ldsMemberAccount', null);
         $writer->text($this->ldsMemberAccount);
         $writer->endElement();
     }
     if ($this->mailingAddress) {
         $writer->startElementNs('fs', 'mailingAddress', null);
         $writer->text($this->mailingAddress);
         $writer->endElement();
     }
     if ($this->personId) {
         $writer->startElementNs('fs', 'personId', null);
         $writer->text($this->personId);
         $writer->endElement();
     }
     if ($this->phoneNumber) {
         $writer->startElementNs('fs', 'phoneNumber', null);
         $writer->text($this->phoneNumber);
         $writer->endElement();
     }
     if ($this->preferredLanguage) {
         $writer->startElementNs('fs', 'preferredLanguage', null);
         $writer->text($this->preferredLanguage);
         $writer->endElement();
     }
     if ($this->treeUserId) {
         $writer->startElementNs('fs', 'treeUserId', null);
         $writer->text($this->treeUserId);
         $writer->endElement();
     }
 }
Example #13
0
 /**
  * Writes the contents of this SourceCitation to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->lang) {
         $writer->writeAttribute('xml:lang', $this->lang);
     }
     parent::writeXmlContents($writer);
     if ($this->citationTemplate) {
         $writer->startElementNs('gx', 'citationTemplate', null);
         $this->citationTemplate->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->fields) {
         foreach ($this->fields as $i => $x) {
             $writer->startElementNs('gx', 'field', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->value) {
         $writer->startElementNs('gx', 'value', null);
         $writer->text($this->value);
         $writer->endElement();
     }
 }
Example #14
0
 /**
  * Writes the contents of this Collection to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->lang) {
         $writer->writeAttribute('xml:lang', $this->lang);
     }
     parent::writeXmlContents($writer);
     if ($this->title) {
         $writer->startElementNs('gx', 'title', null);
         $writer->text($this->title);
         $writer->endElement();
     }
     if ($this->size) {
         $writer->startElementNs('gx', 'size', null);
         $writer->text($this->size);
         $writer->endElement();
     }
     if ($this->content) {
         foreach ($this->content as $i => $x) {
             $writer->startElementNs('gx', 'content', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
 }
Example #15
0
 /**
  * Writes the contents of this SourceDescription to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->about) {
         $writer->writeAttribute('about', $this->about);
     }
     if ($this->mediaType) {
         $writer->writeAttribute('mediaType', $this->mediaType);
     }
     if ($this->resourceType) {
         $writer->writeAttribute('resourceType', $this->resourceType);
     }
     parent::writeXmlContents($writer);
     if ($this->citations) {
         foreach ($this->citations as $i => $x) {
             $writer->startElementNs('gx', 'citation', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->mediator) {
         $writer->startElementNs('gx', 'mediator', null);
         $this->mediator->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->sources) {
         foreach ($this->sources as $i => $x) {
             $writer->startElementNs('gx', 'source', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->analysis) {
         $writer->startElementNs('gx', 'analysis', null);
         $this->analysis->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->componentOf) {
         $writer->startElementNs('gx', 'componentOf', null);
         $this->componentOf->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->titles) {
         foreach ($this->titles as $i => $x) {
             $writer->startElementNs('gx', 'title', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->titleLabel) {
         $writer->startElementNs('gx', 'titleLabel', null);
         $this->titleLabel->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->notes) {
         foreach ($this->notes as $i => $x) {
             $writer->startElementNs('gx', 'note', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->sortKey) {
         $writer->startElementNs('gx', 'sortKey', null);
         $writer->text($this->sortKey);
         $writer->endElement();
     }
     if ($this->descriptions) {
         foreach ($this->descriptions as $i => $x) {
             $writer->startElementNs('gx', 'description', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->identifiers) {
         foreach ($this->identifiers as $i => $x) {
             $writer->startElementNs('gx', 'identifier', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->created) {
         $writer->startElementNs('gx', 'created', null);
         $writer->text($this->created);
         $writer->endElement();
     }
     if ($this->modified) {
         $writer->startElementNs('gx', 'modified', null);
         $writer->text($this->modified);
         $writer->endElement();
     }
     if ($this->coverage) {
         foreach ($this->coverage as $i => $x) {
             $writer->startElementNs('gx', 'coverage', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->rights) {
         foreach ($this->rights as $i => $x) {
             $writer->startElementNs('gx', 'rights', null);
             $writer->text($x);
             $writer->endElement();
         }
     }
     if ($this->fields) {
         foreach ($this->fields as $i => $x) {
             $writer->startElementNs('gx', 'field', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->repository) {
         $writer->startElementNs('gx', 'repository', null);
         $this->repository->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->descriptorRef) {
         $writer->startElementNs('gx', 'descriptor', null);
         $this->descriptorRef->writeXmlContents($writer);
         $writer->endElement();
     }
 }
Example #16
0
 /**
  * Writes the contents of this Gedcomx to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     if ($this->lang) {
         $writer->writeAttribute('xml:lang', $this->lang);
     }
     if ($this->descriptionRef) {
         $writer->writeAttribute('description', $this->descriptionRef);
     }
     if ($this->profile) {
         $writer->writeAttribute('profile', $this->profile);
     }
     parent::writeXmlContents($writer);
     if ($this->attribution) {
         $writer->startElementNs('gx', 'attribution', null);
         $this->attribution->writeXmlContents($writer);
         $writer->endElement();
     }
     if ($this->persons) {
         foreach ($this->persons as $i => $x) {
             $writer->startElementNs('gx', 'person', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->relationships) {
         foreach ($this->relationships as $i => $x) {
             $writer->startElementNs('gx', 'relationship', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->sourceDescriptions) {
         foreach ($this->sourceDescriptions as $i => $x) {
             $writer->startElementNs('gx', 'sourceDescription', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->agents) {
         foreach ($this->agents as $i => $x) {
             $writer->startElementNs('gx', 'agent', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->events) {
         foreach ($this->events as $i => $x) {
             $writer->startElementNs('gx', 'event', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->places) {
         foreach ($this->places as $i => $x) {
             $writer->startElementNs('gx', 'place', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->documents) {
         foreach ($this->documents as $i => $x) {
             $writer->startElementNs('gx', 'document', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->collections) {
         foreach ($this->collections as $i => $x) {
             $writer->startElementNs('gx', 'collection', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->fields) {
         foreach ($this->fields as $i => $x) {
             $writer->startElementNs('gx', 'field', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
     if ($this->recordDescriptors) {
         foreach ($this->recordDescriptors as $i => $x) {
             $writer->startElementNs('gx', 'recordDescriptor', null);
             $x->writeXmlContents($writer);
             $writer->endElement();
         }
     }
 }
Example #17
0
 /**
  * Merges data from provided object with current object
  *
  * @param ExtensibleData $conclusion
  */
 protected function embed(ExtensibleData $conclusion)
 {
     if ($this->lang != null) {
         $this->lang = $conclusion->lang;
     }
     if ($this->confidence != null) {
         $this->confidence = $conclusion->confidence;
     }
     if ($this->attribution != null) {
         $this->attribution = $conclusion->attribution;
     }
     if ($this->analysis != null) {
         $this->analysis = $conclusion->analysis;
     }
     if ($conclusion->notes != null) {
         if ($this->notes != null) {
             $this->notes = array();
         }
         $this->notes = array_merge($this->notes, $conclusion->notes);
     }
     if ($conclusion->sources != null) {
         if ($this->sources == null) {
             $this->sources = array();
         }
         $this->sources = array_merge($this->sources, $conclusion->sources);
     }
     parent::embed($conclusion);
 }
Example #18
0
 /**
  * Writes the contents of this Comment to an XML writer. The startElement is expected to be already provided.
  *
  * @param \XMLWriter $writer The XML writer.
  */
 public function writeXmlContents(\XMLWriter $writer)
 {
     parent::writeXmlContents($writer);
     if ($this->text) {
         $writer->startElementNs('fs', 'text', null);
         $writer->text($this->text);
         $writer->endElement();
     }
     if ($this->created) {
         $writer->startElementNs('fs', 'created', null);
         $writer->text($this->created);
         $writer->endElement();
     }
     if ($this->contributor) {
         $writer->startElementNs('fs', 'contributor', null);
         $this->contributor->writeXmlContents($writer);
         $writer->endElement();
     }
 }