MCPcopy Create free account
hub / github.com/Rello/analytics / extractCacheMetadata

Method extractCacheMetadata

lib/Controller/OutputController.php:254–270  ·  view source on GitHub ↗
(array $result)

Source from the content-addressed store, hash-verified

252 }
253
254 private function extractCacheMetadata(array $result): array {
255 $cache = ['cacheable' => false, 'key' => null, 'notModified' => false];
256 if (!isset($result['cache']) || !is_array($result['cache'])) {
257 return $cache;
258 }
259
260 if (isset($result['cache']['cacheable'])) {
261 $cache['cacheable'] = (bool)$result['cache']['cacheable'];
262 }
263 if (isset($result['cache']['key']) && $result['cache']['key'] !== '') {
264 $cache['key'] = (string)$result['cache']['key'];
265 }
266 if (isset($result['cache']['notModified'])) {
267 $cache['notModified'] = (bool)$result['cache']['notModified'];
268 }
269 return $cache;
270 }
271
272 /**
273 * Preview the data (one row for column pickers, up to 20 for datasource previews)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected