@@ -35,16 +35,6 @@ public function __construct($data) {
35
35
}
36
36
37
37
public static function getAllServerTypes () {
38
- $ cache_key = "bnetdocs-servertypes " ;
39
- $ cache_val = Common::$ cache ->get ($ cache_key );
40
- if ($ cache_val !== false && !empty ($ cache_val )) {
41
- $ ids = explode (", " , $ cache_val );
42
- $ objects = [];
43
- foreach ($ ids as $ id ) {
44
- $ objects [] = new self ($ id );
45
- }
46
- return $ objects ;
47
- }
48
38
if (!isset (Common::$ database )) {
49
39
Common::$ database = DatabaseDriver::getDatabaseObject ();
50
40
}
@@ -59,17 +49,11 @@ public static function getAllServerTypes() {
59
49
if (!$ stmt ->execute ()) {
60
50
throw new QueryException ("Cannot refresh server types " );
61
51
}
62
- $ ids = [];
63
52
$ objects = [];
64
53
while ($ row = $ stmt ->fetch (PDO ::FETCH_OBJ )) {
65
- $ ids [] = (int ) $ row ->id ;
66
54
$ objects [] = new self ($ row );
67
- Common::$ cache ->set (
68
- "bnetdocs-servertype- " . $ row ->id , serialize ($ row ), 300
69
- );
70
55
}
71
56
$ stmt ->closeCursor ();
72
- Common::$ cache ->set ($ cache_key , implode (", " , $ ids ), 300 );
73
57
return $ objects ;
74
58
} catch (PDOException $ e ) {
75
59
throw new QueryException ("Cannot refresh server types " , $ e );
@@ -100,13 +84,6 @@ protected static function normalize(StdClass &$data) {
100
84
}
101
85
102
86
public function refresh () {
103
- $ cache_key = "bnetdocs-servertype- " . $ this ->id ;
104
- $ cache_val = Common::$ cache ->get ($ cache_key );
105
- if ($ cache_val !== false ) {
106
- $ cache_val = unserialize ($ cache_val );
107
- $ this ->label = $ cache_val ->label ;
108
- return true ;
109
- }
110
87
if (!isset (Common::$ database )) {
111
88
Common::$ database = DatabaseDriver::getDatabaseObject ();
112
89
}
@@ -129,7 +106,6 @@ public function refresh() {
129
106
$ stmt ->closeCursor ();
130
107
self ::normalize ($ row );
131
108
$ this ->label = $ row ->label ;
132
- Common::$ cache ->set ($ cache_key , serialize ($ row ), 300 );
133
109
return true ;
134
110
} catch (PDOException $ e ) {
135
111
throw new QueryException ("Cannot refresh server type " , $ e );
0 commit comments