@@ -55,26 +55,6 @@ public static function &getAllEvents(
55
55
$ limit_clause = 'LIMIT ' . (int ) $ index . ', ' . (int ) $ limit ;
56
56
}
57
57
58
- if (empty ($ limit_clause )) {
59
-
60
- $ cache_key = 'bnetdocs-events- ' . hash ( 'md5 ' , $ where_clause );
61
- $ cache_val = Common::$ cache ->get ( $ cache_key );
62
-
63
- if ( $ cache_val !== false && !empty ( $ cache_val ) ) {
64
-
65
- $ ids = explode ( ', ' , $ cache_val );
66
- $ objects = [];
67
-
68
- foreach ( $ ids as $ id ) {
69
- $ objects [] = new self ($ id );
70
- }
71
-
72
- return $ objects ;
73
-
74
- }
75
-
76
- }
77
-
78
58
if ( !isset (Common::$ database ) ) {
79
59
Common::$ database = DatabaseDriver::getDatabaseObject ();
80
60
}
@@ -99,23 +79,12 @@ public static function &getAllEvents(
99
79
throw new QueryException ( 'Cannot refresh all events ' );
100
80
}
101
81
102
- $ ids = [];
103
82
$ objects = [];
104
-
105
83
while ( $ row = $ stmt ->fetch ( PDO ::FETCH_OBJ ) ) {
106
- $ ids [] = (int ) $ row ->id ;
107
84
$ objects [] = new self ( $ row );
108
- Common::$ cache ->set (
109
- 'bnetdocs-event- ' . $ row ->id , serialize ( $ row ), 300
110
- );
111
85
}
112
86
113
87
$ stmt ->closeCursor ();
114
-
115
- if ( empty ( $ limit_clause ) ) {
116
- Common::$ cache ->set ( $ cache_key , implode ( ', ' , $ ids ), 300 );
117
- }
118
-
119
88
return $ objects ;
120
89
121
90
} catch ( PDOException $ e ) {
@@ -235,14 +204,6 @@ protected static function normalize(StdClass &$data, Event &$self = null ) {
235
204
236
205
public function refresh () {
237
206
238
- $ cache_key = 'bnetdocs-event- ' . $ this ->id ;
239
- $ cache_val = Common::$ cache ->get ( $ cache_key );
240
-
241
- if ( $ cache_val !== false ) {
242
- $ cache_val = unserialize ( $ cache_val );
243
- return self ::normalize ( $ cache_val , $ this );
244
- }
245
-
246
207
if ( !isset ( Common::$ database ) ) {
247
208
Common::$ database = DatabaseDriver::getDatabaseObject ();
248
209
}
@@ -272,18 +233,13 @@ public function refresh() {
272
233
$ stmt ->closeCursor ();
273
234
self ::normalize ( $ row , $ this );
274
235
275
- Common::$ cache ->set ( $ cache_key , serialize ( $ row ), 300 );
276
-
277
236
return true ;
278
237
279
238
} catch ( PDOException $ e ) {
280
-
281
239
throw new QueryException ( 'Cannot refresh event ' , $ e );
282
-
283
240
}
284
241
285
242
return false ;
286
-
287
243
}
288
244
289
245
}
0 commit comments