120 if (!array_key_exists($userId, self::$userGroups))
122 if ($USER->getId() == $userId)
124 $groups = $USER->getUserGroupArray();
128 $groups = \Bitrix\Main\UserTable::getUserGroupIds($userId);
132 self::$userGroups[$userId] = $groups;
134 return self::$userGroups[$userId];
144 if (empty(self::$objectStorage))
146 register_shutdown_function([__CLASS__,
"shutdown"]);
149 $c = get_called_class();
150 $innerId =
$id = intval(
$id);
151 if (!array_key_exists($c, self::$objectStorage))
153 self::$objectStorage[$c] = [
"maxId" => 0,
"data" => []];
155 if ($shouldBeNewIfIdIsNull ===
true &&
$id <= 0)
157 $innerId = implode(
"", [
"n", self::$objectStorage[$c][
"maxId"]++]);
159 if (array_key_exists($innerId, self::$objectStorage[$c][
"data"]))
161 $obj = self::$objectStorage[$c][
"data"][$innerId];
166 self::$objectStorage[$c][
"data"][$innerId] = $obj;