64 public static function set($params = array())
66 global $USER, $CACHE_MANAGER;
70 || !isset($params[
'GROUP_ID'])
71 || intval($params[
'GROUP_ID']) <= 0
77 $groupId = intval($params[
'GROUP_ID']);
80 isset($params[
'USER_ID'])
81 && intval($params[
'USER_ID']) > 0
82 ? intval($params[
'USER_ID'])
86 if (intval($userId) <= 0)
91 $connection = \Bitrix\Main\Application::getConnection();
92 $helper = $connection->getSqlHelper();
94 $insertFields = array(
96 "GROUP_ID" => $groupId,
100 $updateFields = array(
104 $merge = $helper->prepareMerge(
105 static::getTableName(),
106 array(
"USER_ID",
"GROUP_ID"),
113 $connection->query($merge[0]);
116 if(defined(
"BX_COMP_MANAGED_CACHE"))
118 $CACHE_MANAGER->ClearByTag(
"sonet_group_view_U".$userId);