@@ -117,6 +117,9 @@ public function many(array $keys)
117
117
118
118
$ results = array_fill_keys ($ keys , null );
119
119
120
+ // First we will retrieve all of the items from the cache using their keys and
121
+ // the prefix value. Then we will need to iterate through each of the items
122
+ // and convert them to an object when they are currently in array format.
120
123
$ values = $ this ->table ()
121
124
->whereIn ('key ' , array_map (function ($ key ) {
122
125
return $ this ->prefix .$ key ;
@@ -170,6 +173,7 @@ public function put($key, $value, $seconds)
170
173
public function putMany (array $ values , $ seconds )
171
174
{
172
175
$ serializedValues = [];
176
+
173
177
$ expiration = $ this ->getTime () + $ seconds ;
174
178
175
179
foreach ($ values as $ key => $ value ) {
@@ -369,19 +373,10 @@ public function forgetIfExpired($key)
369
373
/**
370
374
* Remove all items from the cache.
371
375
*
376
+ * @param array $keys
372
377
* @return bool
373
378
*/
374
- public function flush ()
375
- {
376
- $ this ->table ()->delete ();
377
-
378
- return true ;
379
- }
380
-
381
- /**
382
- * Remove all items from the cache.
383
- */
384
- protected function forgetMany (array $ keys ): bool
379
+ protected function forgetMany (array $ keys )
385
380
{
386
381
$ this ->table ()->whereIn ('key ' , array_map (function ($ key ) {
387
382
return $ this ->prefix .$ key ;
@@ -392,8 +387,12 @@ protected function forgetMany(array $keys): bool
392
387
393
388
/**
394
389
* Remove all expired items from the given set from the cache.
390
+ *
391
+ * @param array $keys
392
+ * @param bool $prefixed
393
+ * @return bool
395
394
*/
396
- protected function forgetManyIfExpired (array $ keys , bool $ prefixed = false ): bool
395
+ protected function forgetManyIfExpired (array $ keys , bool $ prefixed = false )
397
396
{
398
397
$ this ->table ()
399
398
->whereIn ('key ' , $ prefixed ? $ keys : array_map (function ($ key ) {
@@ -405,6 +404,18 @@ protected function forgetManyIfExpired(array $keys, bool $prefixed = false): boo
405
404
return true ;
406
405
}
407
406
407
+ /**
408
+ * Remove all items from the cache.
409
+ *
410
+ * @return bool
411
+ */
412
+ public function flush ()
413
+ {
414
+ $ this ->table ()->delete ();
415
+
416
+ return true ;
417
+ }
418
+
408
419
/**
409
420
* Get a query builder for the cache table.
410
421
*
0 commit comments