194 if (!array_key_exists($userId, self::$cache))
195 self::$cache[$userId] = array();
197 return (array_key_exists($id, self::$cache[$userId]) ? self::$cache[$userId][$id] :
false);
200 protected function setCache($userId, $params = array(), $data = array())
202 if (!array_key_exists($userId, self::$cache))
203 self::$cache[$userId] = array();
205 self::$cache[$userId][$id] = $data;
212 $userId = ($userId ===
null ? $this->userID : $userId);
213 if ($this->IblockID > 0 && $userId > 0)
220 else if (empty($category))
223 $db_res = NotifyEmailTable::getList(array(
225 "USER_ID" => $userId,
227 "=ENTITY_CODE" => NULL
230 while ($res = $db_res->fetch())
231 array_push($return, $res);
233 else if (is_string($category) && ($categories = \CIdeaManagment::getInstance()->idea()->getCategoryList()) && !empty($categories))
235 $category = ToUpper($category);
236 if (array_key_exists($category, $categories))
239 $category = $categories[$category];
240 $db_res = NotifyEmailTable::getList(array(
242 "=USER_ID" => $userId,
244 "=ASCENDED_CATEGORIES.IBLOCK_ID" => \CIdeaManagment::getInstance()->idea()->getCategoryListID(),
245 "<=ASCENDED_CATEGORIES.DEPTH_LEVEL" => $category[
"DEPTH_LEVEL"],
246 "<=ASCENDED_CATEGORIES.LEFT_MARGIN" => $category[
"LEFT_MARGIN"],
247 ">=ASCENDED_CATEGORIES.RIGHT_MARGIN" => $category[
"RIGHT_MARGIN"]
250 while ($res = $db_res->fetch())
251 array_push($return, $res);
254 $this->
setCache($userId, array(
"CATEGORY" => $category), $return);