private function createCommentNode(array $row)
 {
     $comment_node = $this->node_helper->createElement('comment');
     $this->node_helper->appendSubmittedBy($comment_node, $row['submitted_by'], $row['is_anonymous']);
     $this->node_helper->appendSubmittedOn($comment_node, $row['date']);
     $comment = Encoding_SupportedXmlCharEncoding::getXMLCompatibleString($row['comment']);
     $body = $this->node_helper->getNodeWithValue('body', $comment);
     $body->setAttribute('format', $this->getFormat($row['format']));
     $comment_node->appendChild($body);
     return $comment_node;
 }
 public function addFilesToArtifact(DOMElement $artifact_node, $artifact_type_id, $artifact_id)
 {
     $dar = $this->dao->searchFilesForArtifact($artifact_id);
     foreach ($dar as $row) {
         $xml_file_id = ArtifactAttachmentFieldXMLExporter::XML_FILE_PREFIX . $row['id'];
         $file = $this->node_helper->createElement('file');
         $file->setAttribute('id', $xml_file_id);
         $file->appendChild($this->node_helper->getNodeWithValue('filename', $row['filename']));
         $file->appendChild($this->node_helper->getNodeWithValue('path', $this->getPathRelativeToTv3RootPath($artifact_type_id, $row['id'])));
         $file->appendChild($this->node_helper->getNodeWithValue('filesize', $row['filesize']));
         $file->appendChild($this->node_helper->getNodeWithValue('filetype', $row['filetype']));
         $file->appendChild($this->node_helper->getNodeWithValue('description', $row['description']));
         $artifact_node->appendChild($file);
     }
 }
 public function addFilesToArtifact(DOMElement $artifact_node, $artifact_type_id, $artifact_id)
 {
     $dar = $this->dao->searchFilesForArtifact($artifact_id);
     if (count($dar)) {
         $this->archive->addEmptyDir(ArtifactXMLExporter::ARCHIVE_DATA_DIR);
     }
     foreach ($dar as $row) {
         $xml_file_id = ArtifactAttachmentFieldXMLExporter::XML_FILE_PREFIX . $row['id'];
         $path_in_archive = $this->getFilePathInArchive($xml_file_id);
         if ($this->skip_files) {
             $this->archive->addFromString($path_in_archive, '');
         } else {
             $this->archive->addFile($this->getFilePathOnServer($artifact_type_id, $row['id']), $path_in_archive);
         }
         $file = $this->node_helper->createElement('file');
         $file->setAttribute('id', $xml_file_id);
         $file->appendChild($this->node_helper->getNodeWithValue('filename', $row['filename']));
         $file->appendChild($this->node_helper->getNodeWithValue('path', $this->getFilePathInArchive($xml_file_id)));
         $file->appendChild($this->node_helper->getNodeWithValue('filesize', $row['filesize']));
         $file->appendChild($this->node_helper->getNodeWithValue('filetype', $row['filetype']));
         $file->appendChild($this->node_helper->getNodeWithValue('description', $row['description']));
         $artifact_node->appendChild($file);
     }
 }