本文整理汇总了PHP中CUserCounter::ClearByTag方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserCounter::ClearByTag方法的具体用法?PHP CUserCounter::ClearByTag怎么用?PHP CUserCounter::ClearByTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserCounter
的用法示例。
在下文中一共展示了CUserCounter::ClearByTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Update
public static function Update($id, $arFields)
{
global $DB;
$id = intval($id);
if ($id <= 0) {
throw new Exception("id");
}
self::ParseFields($arFields, $id);
$strUpdate = $DB->PrepareUpdate("b_bp_task", $arFields);
$strSql = "UPDATE b_bp_task SET " . "\t" . $strUpdate . ", " . "\tMODIFIED = " . $DB->CurrentTimeFunction() . " " . "WHERE ID = " . intval($id) . " ";
$DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if (is_set($arFields, "USERS")) {
$DB->Query("DELETE FROM b_bp_task_user WHERE TASK_ID = " . intval($id) . " ");
CUserCounter::ClearByTag($id, 'bp_tasks', '**');
$ar = array();
foreach ($arFields["USERS"] as $userId) {
$userId = intval($userId);
if (in_array($userId, $ar)) {
continue;
}
$DB->Query("INSERT INTO b_bp_task_user (USER_ID, TASK_ID) " . "VALUES (" . intval($userId) . ", " . intval($id) . ") ");
CUserCounter::Increment($userId, 'bp_tasks', '**');
$ar[] = $userId;
}
}
$events = GetModuleEvents("bizproc", "OnTaskUpdate");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array($id, $arFields));
}
return $id;
}
示例2: DeleteByWorkflow
public static function DeleteByWorkflow($workflowId)
{
global $DB;
$workflowId = trim($workflowId);
if (strlen($workflowId) <= 0) {
throw new Exception("workflowId");
}
$dbRes = $DB->Query("SELECT ID " . "FROM b_bp_task " . "WHERE WORKFLOW_ID = '" . $DB->ForSql($workflowId) . "' ");
while ($arRes = $dbRes->Fetch()) {
$DB->Query("DELETE FROM b_bp_task_user " . "WHERE TASK_ID = " . intval($arRes["ID"]) . " ", true);
CUserCounter::ClearByTag($arRes["ID"], 'bp_tasks', '**');
$events = GetModuleEvents("bizproc", "OnTaskDelete");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array(intval($arRes["ID"])));
}
}
$DB->Query("DELETE FROM b_bp_task " . "WHERE WORKFLOW_ID = '" . $DB->ForSql($workflowId) . "' ", true);
}
示例3: ClearByTag
public static function ClearByTag($tag, $code, $site_id = SITE_ID, $sendPull = true)
{
return CUserCounter::ClearByTag($tag, $code, $site_id, $sendPull);
}