1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace App\Models\Store;
9
10use JsonSerializable;
11
12class ExtraDataTournamentBanner extends ExtraDataBase implements JsonSerializable
13{
14 const TYPE = 'tournament-banner';
15
16 public string $countryAcronym;
17 public int $tournamentId;
18
19 public function __construct(array $data)
20 {
21 $this->tournamentId = get_int($data['tournament_id']);
22 $this->countryAcronym = $data['cc'];
23 }
24
25 public function jsonSerialize(): array
26 {
27 return array_merge(parent::jsonSerialize(), [
28 'cc' => $this->countryAcronym,
29 'tournament_id' => $this->tournamentId,
30 ]);
31 }
32}