本文整理汇总了PHP中MessageGroups::prioritycache方法的典型用法代码示例。如果您正苦于以下问题:PHP MessageGroups::prioritycache方法的具体用法?PHP MessageGroups::prioritycache怎么用?PHP MessageGroups::prioritycache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageGroups
的用法示例。
在下文中一共展示了MessageGroups::prioritycache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPriority
/**
* We want to de-emphasize time sensitive groups like news for 2009.
* They can still exist in the system, but should not appear in front
* of translators looking to do some useful work.
*
* @param MessageGroup|string $group Message group ID
* @return string Message group priority
* @since 2011-12-12
*/
public static function getPriority($group)
{
if (!isset(self::$prioritycache)) {
self::$prioritycache = array();
// Abusing this table originally intented for other purposes
$db = wfGetDB(DB_SLAVE);
$table = 'translate_groupreviews';
$fields = array('tgr_group', 'tgr_state');
$conds = array('tgr_lang' => '*priority');
$res = $db->select($table, $fields, $conds, __METHOD__);
foreach ($res as $row) {
self::$prioritycache[$row->tgr_group] = $row->tgr_state;
}
}
if ($group instanceof MessageGroup) {
$id = $group->getId();
} else {
$id = $group;
}
return isset(self::$prioritycache[$id]) ? self::$prioritycache[$id] : '';
}