initial commit
This commit is contained in:
commit
d96b74e6c1
88 changed files with 15238 additions and 0 deletions
37
app/Data/MovieResult.php
Normal file
37
app/Data/MovieResult.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Data;
|
||||
|
||||
use App\Models\Movie;
|
||||
|
||||
readonly class MovieResult
|
||||
{
|
||||
public function __construct(
|
||||
public string $imdbId,
|
||||
public string $title,
|
||||
public ?int $year,
|
||||
public ?string $director,
|
||||
public ?string $actors,
|
||||
public ?string $plot,
|
||||
public ?string $genre,
|
||||
public ?string $mpaaRating,
|
||||
public ?array $criticScores,
|
||||
public ?string $poster,
|
||||
) {}
|
||||
|
||||
public static function fromModel(Movie $movie): self
|
||||
{
|
||||
return new self(
|
||||
imdbId: $movie->imdb_id,
|
||||
title: $movie->title,
|
||||
year: $movie->year,
|
||||
director: $movie->director,
|
||||
actors: $movie->actors,
|
||||
plot: $movie->plot,
|
||||
genre: $movie->genre,
|
||||
mpaaRating: $movie->mpaa_rating,
|
||||
criticScores: $movie->critic_scores,
|
||||
poster: $movie->poster,
|
||||
);
|
||||
}
|
||||
}
|
||||
14
app/Data/MovieSearchResult.php
Normal file
14
app/Data/MovieSearchResult.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Data;
|
||||
|
||||
readonly class MovieSearchResult
|
||||
{
|
||||
public function __construct(
|
||||
public string $title,
|
||||
public int $year,
|
||||
public string $imdbId,
|
||||
public string $type,
|
||||
public string $poster,
|
||||
) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue