static function getWorkspaceColor($ws_id) { if (self::$color_cache == null) { $res = DB::execute("SELECT object_id, color FROM ".TABLE_PREFIX. "workspaces"); $rows = $res->fetchAll(); if (is_array($rows)) { self::$color_cache = array(); foreach ($rows as $row) self::$color_cache[$row['object_id']] = $row['color']; } } return array_var(self::$color_cache, $ws_id); }