本文整理汇总了PHP中Rule::initReplies方法的典型用法代码示例。如果您正苦于以下问题:PHP Rule::initReplies方法的具体用法?PHP Rule::initReplies怎么用?PHP Rule::initReplies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule::initReplies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRule
public static function getRule($ruleID)
{
if ($ruleID) {
$rule = DB::execute("SELECT entryID, ruleName, userID FROM rules WHERE ruleID='" . ms($ruleID) . "'");
if (count($rule) > 0) {
$ruleObj = new Rule($rule["userID"]);
$ruleObj->setRuleID($ruleID);
$ruleObj->setEntryID($rule["entryID"]);
$ruleObj->setRuleName($rule["ruleName"]);
$keywords = DB::fetchAll("SELECT keyword FROM rules AS r, keyword_entries AS k WHERE ruleID='" . ms($ruleID) . "' AND r.entryID=k.entryID");
$replies = DB::fetchAll("SELECT messageID FROM reply_msg WHERE ruleID='" . ms($ruleID) . "'");
$ruleObj->initKeywords($keywords);
$ruleObj->initReplies($replies);
return $ruleObj;
} else {
if (DEBUG_MODE) {
echo "[RuleFactory | getRule] Cannot find rule from DB where ruleID = " . $this->ruleID;
}
}
}
exit;
}