22 lines
417 B
PHP
22 lines
417 B
PHP
<?php
|
|
|
|
namespace App\Classes;
|
|
|
|
class GlobalsFetcher extends PageFetcher
|
|
{
|
|
public function fetch(): ?array
|
|
{
|
|
$cacheKey = "globals";
|
|
$cached = $this->cacheGet($cacheKey);
|
|
|
|
if ($cached) return $cached;
|
|
|
|
$globals = $this->fetchFromApi("optimized_globals");
|
|
|
|
if (empty($globals)) return null;
|
|
|
|
$this->cacheSet($cacheKey, $globals[0]);
|
|
|
|
return $globals[0];
|
|
}
|
|
}
|