@@ 136-158 (lines=23) @@ | ||
133 | * @param array $identifiers |
|
134 | * @return array |
|
135 | */ |
|
136 | protected function doLoadMany(array $identifiers) |
|
137 | { |
|
138 | $result = array(); |
|
139 | $now = time(); |
|
140 | ||
141 | foreach ($this->getOption('client')->get($identifiers, $this->getOption('compress', 0)) as $id => $source) { |
|
142 | $source = $this->getProcessedLoadedValue($source); |
|
143 | ||
144 | if (false !== $source) { |
|
145 | $i = $this->getIdentifierWithoutPrefix($id); |
|
146 | ||
147 | if (array_key_exists('expiresAt', $source) && ($source['expiresAt'] < $now)) { |
|
148 | $result[$i] = false; |
|
149 | } else { |
|
150 | $result[$i] = $source['data']; |
|
151 | } |
|
152 | } |
|
153 | } |
|
154 | ||
155 | $this->fillNotFoundKeys($result, $identifiers); |
|
156 | ||
157 | return $result; |
|
158 | } |
|
159 | ||
160 | /** |
|
161 | * {@inheritdoc} |
@@ 55-77 (lines=23) @@ | ||
52 | * @param array $identifiers |
|
53 | * @return array |
|
54 | */ |
|
55 | protected function doLoadMany(array $identifiers) |
|
56 | { |
|
57 | $result = array(); |
|
58 | $now = time(); |
|
59 | ||
60 | foreach ($this->getOption('client')->getMulti($identifiers) as $id => $source) { |
|
61 | $source = $this->getProcessedLoadedValue($source); |
|
62 | ||
63 | if (false !== $source) { |
|
64 | $i = $this->getIdentifierWithoutPrefix($id); |
|
65 | ||
66 | if (array_key_exists('expiresAt', $source) && ($source['expiresAt'] < $now)) { |
|
67 | $result[$i] = false; |
|
68 | } else { |
|
69 | $result[$i] = $source['data']; |
|
70 | } |
|
71 | } |
|
72 | } |
|
73 | ||
74 | $this->fillNotFoundKeys($result, $identifiers); |
|
75 | ||
76 | return $result; |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * {@inheritdoc} |