本文整理匯總了PHP中Revision::loadFromConds方法的典型用法代碼示例。如果您正苦於以下問題:PHP Revision::loadFromConds方法的具體用法?PHP Revision::loadFromConds怎麽用?PHP Revision::loadFromConds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Revision
的用法示例。
在下文中一共展示了Revision::loadFromConds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: newFromConds
/**
* Given a set of conditions, fetch a revision.
*
* @param array $conditions
* @return Revision
* @static
* @access private
*/
static function newFromConds($conditions)
{
$db =& wfGetDB(DB_SLAVE);
$row = Revision::loadFromConds($db, $conditions);
if (is_null($row)) {
$dbw =& wfGetDB(DB_MASTER);
$row = Revision::loadFromConds($dbw, $conditions);
}
return $row;
}
示例2: newFromConds
/**
* Given a set of conditions, fetch a revision.
*
* @param array $conditions
* @return Revision
* @access private
* @static
*/
private static function newFromConds($conditions)
{
$db = wfGetDB(DB_SLAVE);
$row = Revision::loadFromConds($db, $conditions);
if (is_null($row) && wfGetLB()->getServerCount() > 1) {
$dbw = wfGetDB(DB_MASTER);
$row = Revision::loadFromConds($dbw, $conditions);
}
return $row;
}
示例3: newFromConds
/**
* Given a set of conditions, fetch a revision.
*
* @param array $conditions
* @param bool $useMaster
*
* @return Revision|null
*/
public static function newFromConds($conditions, $useMaster = false)
{
$dbType = $useMaster ? DB_MASTER : DB_SLAVE;
$db = wfGetDB($dbType);
$rev = Revision::loadFromConds($db, $conditions);
if (is_null($rev) && wfGetLB()->getServerCount() > 1) {
$dbw = wfGetDB(DB_MASTER);
$rev = Revision::loadFromConds($dbw, $conditions);
}
return $rev;
}