| 1 | <?php |
||
| 14 | final class Album |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var string|null |
||
| 18 | */ |
||
| 19 | private $name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var Artist|null |
||
| 23 | */ |
||
| 24 | private $artist; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string|null |
||
| 28 | */ |
||
| 29 | private $mbid; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string|null |
||
| 33 | */ |
||
| 34 | private $url; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var Image[] |
||
| 38 | */ |
||
| 39 | private $images; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param Image[] $images |
||
| 43 | */ |
||
| 44 | public function __construct(?string $name, ?Artist $artist, ?string $mbid, ?string $url, array $images) |
||
| 52 | |||
| 53 | public function getName(): ?string |
||
| 57 | |||
| 58 | public function getArtist(): ?Artist |
||
| 62 | |||
| 63 | public function getMbid(): ?string |
||
| 67 | |||
| 68 | public function getUrl(): ?string |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return Image[] |
||
| 75 | */ |
||
| 76 | public function getImages(): array |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return Album |
||
| 83 | */ |
||
| 84 | public static function fromApi(array $data): self |
||
| 96 | |||
| 97 | private static function createImagesFromApi(array $data): array |
||
| 109 | } |
||
| 110 |