當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PageModel::pageReferenceTable方法代碼示例

本文整理匯總了PHP中PageModel::pageReferenceTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageModel::pageReferenceTable方法的具體用法?PHP PageModel::pageReferenceTable怎麽用?PHP PageModel::pageReferenceTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PageModel的用法示例。


在下文中一共展示了PageModel::pageReferenceTable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: InvalidArgumentException

 function __construct($args)
 {
     $args = array_merge(array('depth' => 'response'), $args);
     $this->depth = $args['depth'];
     // argument assertions
     if (!isset($args['pageID'])) {
         throw new InvalidArgumentException('Missing pageID as argument to PageModel constructor');
     }
     if (!isset(self::$pageTable)) {
         self::$pageTable = QFrame_Db_Table::getTable('page');
     }
     if (!isset(self::$sectionTable)) {
         self::$sectionTable = QFrame_Db_Table::getTable('section');
     }
     if (!isset(self::$questionTable)) {
         self::$questionTable = QFrame_Db_Table::getTable('question');
     }
     if (!isset(self::$ruleTable)) {
         self::$ruleTable = QFrame_Db_Table::getTable('rule');
     }
     if (!isset(self::$questionTypeTable)) {
         self::$questionTypeTable = QFrame_Db_Table::getTable('question_type');
     }
     if (!isset(self::$pageReferenceTable)) {
         self::$pageReferenceTable = QFrame_Db_Table::getTable('page_reference');
     }
     if (!isset(self::$referenceDetailTable)) {
         self::$referenceDetailTable = QFrame_Db_Table::getTable('reference_detail');
     }
     $rows = self::$pageTable->fetchRows('pageID', $args['pageID']);
     $this->pageRow = $rows[0];
     // page row assertion
     if ($this->pageRow === NULL) {
         throw new Exception('Page not found [' . $args['pageID'] . ']');
     }
     $ruleRows = self::$ruleTable->fetchRows('targetID', $this->pageRow->pageID, null, $this->pageRow->instanceID);
     $disableCount = 0;
     foreach ($ruleRows as $row) {
         if ($row->enabled === 'Y' && $row->type === 'disablePage') {
             $disableCount++;
         } elseif ($row->enabled === 'Y' && $row->type === 'enablePage') {
             $disableCount--;
         }
     }
     if ($this->pageRow->defaultPageHidden) {
         $disableCount++;
     }
     if ($disableCount != $this->pageRow->disableCount) {
         $this->pageRow->disableCount = $disableCount;
         $this->pageRow->save();
     }
     if ($this->depth !== 'page') {
         $this->_loadSections();
     }
     $pageReferenceRows = self::$pageReferenceTable->fetchRows('pageID', $this->pageRow->pageID, null, $this->pageRow->instanceID);
     foreach ($pageReferenceRows as $row) {
         $rows = self::$referenceDetailTable->fetchRows('referenceDetailID', $row->referenceDetailID, null, $this->pageRow->instanceID);
         $this->referenceDetailRows[] = $rows[0]->toArray();
     }
 }
開發者ID:humansky,項目名稱:qframe,代碼行數:60,代碼來源:PageModel.php


注:本文中的PageModel::pageReferenceTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。