Projekt

Obecné

Profil

Stáhnout (793 Bajtů) Statistiky
| Větev: | Revize:
1
<?php
2

    
3
namespace Illuminate\Cache;
4

    
5
trait RetrievesMultipleKeys
6
{
7
    /**
8
     * Retrieve multiple items from the cache by key.
9
     *
10
     * Items not found in the cache will have a null value.
11
     *
12
     * @param  array  $keys
13
     * @return array
14
     */
15
    public function many(array $keys)
16
    {
17
        $return = [];
18

    
19
        foreach ($keys as $key) {
20
            $return[$key] = $this->get($key);
21
        }
22

    
23
        return $return;
24
    }
25

    
26
    /**
27
     * Store multiple items in the cache for a given number of minutes.
28
     *
29
     * @param  array  $values
30
     * @param  int  $minutes
31
     * @return void
32
     */
33
    public function putMany(array $values, $minutes)
34
    {
35
        foreach ($values as $key => $value) {
36
            $this->put($key, $value, $minutes);
37
        }
38
    }
39
}
(15-15/19)