@@ -42,16 +42,6 @@ public function __construct($data) {
42
42
}
43
43
44
44
public static function getAll () {
45
- $ cache_key = "bnetdocs-newscategories " ;
46
- $ cache_val = Common::$ cache ->get ($ cache_key );
47
- if ($ cache_val !== false && !empty ($ cache_val )) {
48
- $ ids = explode (", " , $ cache_val );
49
- $ objects = [];
50
- foreach ($ ids as $ id ) {
51
- $ objects [] = new self ($ id );
52
- }
53
- return $ objects ;
54
- }
55
45
if (!isset (Common::$ database )) {
56
46
Common::$ database = DatabaseDriver::getDatabaseObject ();
57
47
}
@@ -68,17 +58,11 @@ public static function getAll() {
68
58
if (!$ stmt ->execute ()) {
69
59
throw new QueryException ("Cannot refresh news categories " );
70
60
}
71
- $ ids = [];
72
61
$ objects = [];
73
62
while ($ row = $ stmt ->fetch (PDO ::FETCH_OBJ )) {
74
- $ ids [] = (int ) $ row ->id ;
75
63
$ objects [] = new self ($ row );
76
- Common::$ cache ->set (
77
- "bnetdocs-newscategory- " . $ row ->id , serialize ($ row ), 300
78
- );
79
64
}
80
65
$ stmt ->closeCursor ();
81
- Common::$ cache ->set ($ cache_key , implode (", " , $ ids ), 300 );
82
66
return $ objects ;
83
67
} catch (PDOException $ e ) {
84
68
throw new QueryException ("Cannot refresh news categories " , $ e );
@@ -112,15 +96,6 @@ protected static function normalize(StdClass &$data) {
112
96
}
113
97
114
98
public function refresh () {
115
- $ cache_key = "bnetdocs-newscategory- " . $ this ->id ;
116
- $ cache_val = Common::$ cache ->get ($ cache_key );
117
- if ($ cache_val !== false ) {
118
- $ cache_val = unserialize ($ cache_val );
119
- $ this ->filename = $ cache_val ->filename ;
120
- $ this ->label = $ cache_val ->label ;
121
- $ this ->sort_id = $ cache_val ->sort_id ;
122
- return true ;
123
- }
124
99
if (!isset (Common::$ database )) {
125
100
Common::$ database = DatabaseDriver::getDatabaseObject ();
126
101
}
@@ -147,7 +122,6 @@ public function refresh() {
147
122
$ this ->filename = $ row ->filename ;
148
123
$ this ->label = $ row ->label ;
149
124
$ this ->sort_id = $ row ->sort_id ;
150
- Common::$ cache ->set ($ cache_key , serialize ($ row ), 300 );
151
125
return true ;
152
126
} catch (PDOException $ e ) {
153
127
throw new QueryException ("Cannot refresh news category " , $ e );
0 commit comments