19 lines
397 B
PHP
19 lines
397 B
PHP
<?php
|
|
|
|
namespace App\Classes;
|
|
|
|
class MovieFetcher extends PageFetcher
|
|
{
|
|
public function fetch(string $url): ?array
|
|
{
|
|
$cacheKey = "movie_" . md5($url);
|
|
$cached = $this->cacheGet($cacheKey);
|
|
if ($cached) return $cached;
|
|
|
|
$movie = $this->fetchSingleFromApi("optimized_movies", $url);
|
|
if (!$movie) return null;
|
|
|
|
$this->cacheSet($cacheKey, $movie);
|
|
return $movie;
|
|
}
|
|
}
|