85 public static function set($params = array())
87 global $USER, $CACHE_MANAGER;
92 || !isset($params[
'GROUP_ID'])
93 || intval($params[
'GROUP_ID']) <= 0
99 $groupId = intval($params[
'GROUP_ID']);
102 isset($params[
'USER_ID'])
103 && intval($params[
'USER_ID']) > 0
104 ? intval($params[
'USER_ID'])
108 if (intval($userId) <= 0)
113 $connection = \Bitrix\Main\Application::getConnection();
114 $helper = $connection->getSqlHelper();
116 $insertFields = array(
117 "USER_ID" => $userId,
118 "GROUP_ID" => $groupId,
122 $updateFields = array(
126 $merge = $helper->prepareMerge(
127 static::getTableName(),
128 array(
"USER_ID",
"GROUP_ID"),
135 $res = $connection->query($merge[0]);
140 && defined(
"BX_COMP_MANAGED_CACHE")
143 $CACHE_MANAGER->clearByTag(
"sonet_group_favorites_U".$userId);