本文整理汇总了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();
}
}