| @@ 49-55 (lines=7) @@ | ||
| 46 | * @return string |
|
| 47 | * @throws \InvalidArgumentException |
|
| 48 | */ |
|
| 49 | public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512) |
|
| 50 | { |
|
| 51 | $callback = function(CacheItemInterface $item){ |
|
| 52 | return $item->get(); |
|
| 53 | }; |
|
| 54 | return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth); |
|
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * @param string $tagName |
|
| @@ 119-126 (lines=8) @@ | ||
| 116 | * |
|
| 117 | * @return string |
|
| 118 | */ |
|
| 119 | public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512) |
|
| 120 | { |
|
| 121 | $callback = function(CacheItemInterface $item){ |
|
| 122 | return $item->get(); |
|
| 123 | }; |
|
| 124 | ||
| 125 | return json_encode(array_map($callback, array_values($this->getItemsByTags($tagNames))), $option, $depth); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * @param string $tagName |
|