17
17
* @property-read IStorage $storage
18
18
* @property-read string $namespace
19
19
*/
20
- class Cache extends Nette \Object implements \ArrayAccess
20
+ class Cache extends Nette \Object
21
21
{
22
22
/** dependency */
23
23
const PRIORITY = 'priority ' ,
@@ -40,12 +40,6 @@ class Cache extends Nette\Object implements \ArrayAccess
40
40
/** @var string */
41
41
private $ namespace ;
42
42
43
- /** @var string last query cache used by offsetGet() */
44
- private $ key ;
45
-
46
- /** @var mixed last query cache used by offsetGet() */
47
- private $ data ;
48
-
49
43
50
44
public function __construct (IStorage $ storage , $ namespace = NULL )
51
45
{
@@ -123,7 +117,6 @@ public function load($key, $fallback = NULL)
123
117
*/
124
118
public function save ($ key , $ data , array $ dependencies = NULL )
125
119
{
126
- $ this ->key = $ this ->data = NULL ;
127
120
$ key = $ this ->generateKey ($ key );
128
121
129
122
if ($ data instanceof Nette \Callback || $ data instanceof \Closure) {
@@ -196,7 +189,6 @@ public function remove($key)
196
189
*/
197
190
public function clean (array $ conditions = NULL )
198
191
{
199
- $ this ->key = $ this ->data = NULL ;
200
192
$ this ->storage ->clean ((array ) $ conditions );
201
193
}
202
194
@@ -268,65 +260,6 @@ protected function generateKey($key)
268
260
}
269
261
270
262
271
- /********************* interface ArrayAccess ****************d*g**/
272
-
273
-
274
- /**
275
- * @deprecated
276
- */
277
- public function offsetSet ($ key , $ data )
278
- {
279
- trigger_error ('Using [] is deprecated; use Cache::save(key, data) instead. ' , E_USER_DEPRECATED );
280
- $ this ->save ($ key , $ data );
281
- }
282
-
283
-
284
- /**
285
- * @deprecated
286
- */
287
- public function offsetGet ($ key )
288
- {
289
- trigger_error ('Using [] is deprecated; use Cache::load(key) instead. ' , E_USER_DEPRECATED );
290
- $ key = is_scalar ($ key ) ? (string ) $ key : serialize ($ key );
291
- if ($ this ->key !== $ key ) {
292
- $ this ->key = $ key ;
293
- $ this ->data = $ this ->load ($ key );
294
- }
295
- return $ this ->data ;
296
- }
297
-
298
-
299
- /**
300
- * @deprecated
301
- */
302
- public function offsetExists ($ key )
303
- {
304
- trigger_error ('Using [] is deprecated; use Cache::load(key) !== NULL instead. ' , E_USER_DEPRECATED );
305
- $ this ->key = $ this ->data = NULL ;
306
- return $ this ->offsetGet ($ key ) !== NULL ;
307
- }
308
-
309
-
310
- /**
311
- * @deprecated
312
- */
313
- public function offsetUnset ($ key )
314
- {
315
- trigger_error ('Using [] is deprecated; use Cache::remove(key) instead. ' , E_USER_DEPRECATED );
316
- $ this ->save ($ key , NULL );
317
- }
318
-
319
-
320
- /**
321
- * @deprecated
322
- */
323
- public function release ()
324
- {
325
- trigger_error (__METHOD__ . '() is deprecated. ' , E_USER_DEPRECATED );
326
- $ this ->key = $ this ->data = NULL ;
327
- }
328
-
329
-
330
263
/********************* dependency checkers ****************d*g**/
331
264
332
265
0 commit comments