当前位置: 首页>>代码示例>>PHP>>正文


PHP FileModel::fetchProperties方法代码示例

本文整理汇总了PHP中FileModel::fetchProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP FileModel::fetchProperties方法的具体用法?PHP FileModel::fetchProperties怎么用?PHP FileModel::fetchProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileModel的用法示例。


在下文中一共展示了FileModel::fetchProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: toXML

 /**
  * Exports an Instance XML Document
  *
  * @param  integer If true, exports the entire questionnaire definition (question text, etc). 
  *                 If false, only exports guid and response data.
  * @param array PageHeader strings to export.  If empty, export entire instance.
  * @return string XML Document
  */
 public function toXML($complete = 0, $pageHeaders = array())
 {
     $instanceID = $this->instanceRow->instanceID;
     QFrame_Db_Table::resetAll();
     $this->attachmentQuestions = FileModel::fetchObjectIdsByInstance($this->instanceRow->instanceID);
     $instance = new InstanceModel(array('instanceID' => $instanceID, 'depth' => 'response'));
     $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $xml .= '<csi:questionnaire';
     $xml .= ' xmlns:csi="http://www.csinitiative.com/ns/csi-qframe"';
     $xml .= ' questionnaireName="' . self::_xmlentities($instance->questionnaireName) . '" questionnaireVersion="' . self::_xmlentities($instance->questionnaireVersion) . '" revision="' . self::_xmlentities($instance->revision) . '" targetQFrameVersion="' . QFRAME_VERSION . '" instanceName="' . self::_xmlentities($instance->instanceName) . '">' . "\n";
     $xml .= "  <csi:pages>\n";
     while ($page = $instance->nextPage()) {
         if (count($pageHeaders) > 0 && array_search($page->pageHeader, $pageHeaders) === FALSE) {
             continue;
         }
         $xml .= "    <csi:page>\n";
         if ($complete) {
             $xml .= "      <csi:pageHeader>" . self::_xmlentities($page->pageHeader) . "</csi:pageHeader>\n";
         }
         $xml .= "      <csi:pageGUID>" . self::_xmlentities($page->pageGUID) . "</csi:pageGUID>\n";
         $xml .= "      <csi:seqNumber>" . self::_xmlentities($page->seqNumber) . "</csi:seqNumber>\n";
         if ($complete) {
             $xml .= "      <csi:description>" . self::_xmlentities($page->description) . "</csi:description>\n";
             $xml .= "      <csi:headerText>" . self::_xmlentities($page->headerText) . "</csi:headerText>\n";
             $xml .= "      <csi:footerText>" . self::_xmlentities($page->footerText) . "</csi:footerText>\n";
             $xml .= "      <csi:cloneable>" . self::_xmlentities($page->cloneable) . "</csi:cloneable>\n";
             $xml .= "      <csi:defaultPageHidden>" . self::_xmlentities($page->defaultPageHidden) . "</csi:defaultPageHidden>\n";
         }
         $xml .= "      <csi:sections>\n";
         while ($section = $page->nextSection()) {
             $xml .= "        <csi:section>\n";
             if ($complete) {
                 $xml .= '          <csi:sectionHeader>' . self::_xmlentities($section->sectionHeader) . "</csi:sectionHeader>\n";
             }
             $xml .= '          <csi:sectionGUID>' . self::_xmlentities($section->sectionGUID) . "</csi:sectionGUID>\n";
             $xml .= '          <csi:seqNumber>' . self::_xmlentities($section->seqNumber) . "</csi:seqNumber>\n";
             if ($complete) {
                 $xml .= '          <csi:description>' . self::_xmlentities($section->description) . "</csi:description>\n";
                 $xml .= '          <csi:cloneable>' . self::_xmlentities($section->cloneable) . "</csi:cloneable>\n";
                 $xml .= '          <csi:defaultSectionHidden>' . self::_xmlentities($section->defaultSectionHidden) . "</csi:defaultSectionHidden>\n";
                 $references = $section->references;
                 if (count($references) > 0) {
                     $xml .= "          <csi:sectionReferences>";
                     foreach ($references as $reference) {
                         $xml .= "            <csi:reference>";
                         $xml .= '              <csi:shortName>' . self::_xmlentities($reference['shortName']) . "</csi:shortName>\n";
                         $xml .= '              <csi:referenceName>' . self::_xmlentities($reference['referenceName']) . "</csi:referenceName>\n";
                         $xml .= '              <csi:item>' . self::_xmlentities($reference['item']) . "</csi:item>\n";
                         $xml .= '              <csi:referenceURL>' . self::_xmlentities($reference['referenceURL']) . "</csi:referenceURL>\n";
                         $xml .= '              <csi:referenceText>' . self::_xmlentities($reference['referenceText']) . "</csi:referenceText>\n";
                         $xml .= "</csi:reference>\n";
                     }
                     $xml .= "</csi:sectionReferences>\n";
                 }
             }
             $xml .= "          <csi:questions>\n";
             while ($question = $section->nextQuestion()) {
                 $padding = '';
                 if (count($question->children)) {
                     $xml .= "            <csi:questionGroup>\n";
                     if ($complete) {
                         $xml .= "              <csi:qText>" . self::_xmlentities($question->qText) . "</csi:qText>\n";
                     }
                     $xml .= "              <csi:questionGUID>" . self::_xmlentities($question->questionGUID) . "</csi:questionGUID>\n";
                     $xml .= "              <csi:seqNumber>" . self::_xmlentities($question->seqNumber) . "</csi:seqNumber>\n";
                     if ($complete && strlen(self::_xmlentities($question->questionNumber))) {
                         $xml .= "              <csi:groupQuestionNumber>" . self::_xmlentities($question->questionNumber) . "</csi:groupQuestionNumber>\n";
                     }
                     $xml .= "              <csi:cloneable>" . self::_xmlentities($question->cloneable) . "</csi:cloneable>\n";
                     $xml .= "              <csi:groupDefaultQuestionHidden>" . self::_xmlentities($question->defaultQuestionHidden) . "</csi:groupDefaultQuestionHidden>\n";
                     $references = $question->references;
                     if (count($references) > 0) {
                         $xml .= "              <csi:groupQuestionReferences>";
                         foreach ($references as $reference) {
                             $xml .= "              <csi:reference>\n";
                             $xml .= "                <csi:shortName>" . self::_xmlentities($reference['shortName']) . "</csi:shortName>\n";
                             $xml .= "                <csi:referenceName>" . self::_xmlentities($reference['referenceName']) . "</csi:referenceName>\n";
                             $xml .= "                <csi:item>" . self::_xmlentities($reference['item']) . "</csi:item>\n";
                             $xml .= "                <csi:referenceURL>" . self::_xmlentities($reference['referenceURL']) . "</csi:referenceURL>\n";
                             $xml .= "                <csi:referenceText>" . self::_xmlentities($reference['referenceText']) . "</csi:referenceText>\n";
                             $xml .= "              </csi:reference>\n";
                         }
                         $xml .= "</csi:groupQuestionReferences>\n";
                     }
                     if (isset($this->attachmentQuestions['QuestionModel'][$question->questionID])) {
                         $fileObj = new FileModel($question);
                         $ids = $fileObj->fetchAll();
                         if (count($ids)) {
                             $xml .= "              <csi:attachments>\n";
                             foreach ($ids as $id) {
                                 $xml .= "                <csi:attachment>\n";
                                 $file = $fileObj->fetchProperties($id);
//.........这里部分代码省略.........
开发者ID:humansky,项目名称:qframe,代码行数:101,代码来源:InstanceModel.php


注:本文中的FileModel::fetchProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。