Compare commits

..

4 Commits

24 changed files with 72290 additions and 19 deletions

View File

@ -21,9 +21,10 @@ services:
$handlers: !tagged_iterator 'app.usecase'
App\Application\UseCase\:
resource: '../src/Application/UseCase/'
resource: '../src/Application/UseCase/**'
tags: ['app.usecase']
exclude:
- '../src/Application/UseCase/*Request.php'
- '../src/Application/UseCase/**/*Request.php'
App\Application\LolEsportOfficialAPI\LolEsportOfficialAPIEngine: '@App\Infrastructure\LolEsportOfficialAPI\HTTPLolEsportOfficialAPI'
App\Application\SportRadar\SportRadarEngine: '@App\Infrastructure\SportRadar\HTTPSportRadarEngine'

View File

@ -2,4 +2,5 @@ imports:
- { resource: services.yaml }
services:
App\Application\LolEsportOfficialAPI\LolEsportOfficialAPIEngine: '@App\Infrastructure\LolEsportOfficialAPI\FakeLolEsportOfficialAPIEngine'
App\Application\SportRadar\SportRadarEngine: '@App\Infrastructure\SportRadar\FakeSportRadarEngine'

View File

@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Application\LolEsportOfficialAPI;
interface LolEsportOfficialAPIEngine
{
public const string PROVIDER_ID = 'c07b7834-de0f-11f0-bcf1-8727592b333f';
/**
* @return array<{
* id: string,
* slug: string,
* name: string,
* code: string,
* status: string
* }>
*/
public function getTeams();
/**
* @return array<{
* id: string,
* slug: string,
* name: string,
* region: string,
* }>
*/
public function getLeagues();
/**
* @param string $leagueId
* @return array<{
* id: string,
* slug: string,
* startDate: \DateTimeImmutable,
* endDate: \DateTimeImmutable,
* }>
*/
public function getSeasons(string $leagueId); // "Tournament"
public function getSchedules();
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Application\ReadModel;
readonly class League
{
public function __construct(
public string $id,
public string $providerId,
public string $providerLeagueId,
public string $name,
) {
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Application\ReadModel;
readonly class Season
{
public function __construct(
public string $id,
public string $providerId,
public string $providerSeasonId,
public int $year,
public string $kind,
public string $leagueId,
) {
}
}

View File

@ -8,6 +8,8 @@ use App\Domain\Enum\ENHLSeasonType;
interface SportRadarEngine
{
public const string PROVIDER_ID = '885fe581-c4c3-45e7-a06c-29ece7d47fad';
/**
* @return array{
* league: array{

View File

@ -57,6 +57,7 @@ class GenerateGamesCalendar
$away = $this->entityManager->getRepository(Team::class)->find($game->awayTeamId) ?? throw new \Exception('Team not found');
$events[] = Event::create($away->name . ' vs ' . $home->name)
->uniqueIdentifier($game->id)
->startsAt($game->startTimeScheduled)
->endsAt($game->endTimeScheduled ?? $game->startTimeScheduled->modify('+3 hours')) // should be a parameter of the league
->address($game->venue);

View File

@ -0,0 +1,138 @@
<?php
namespace App\Application\UseCase\LeagueOfLegends;
use App\Application\LolEsportOfficialAPI\LolEsportOfficialAPIEngine;
use App\Application\ReadModel\League as LeagueRM;
use App\Application\ReadModel\Season as SeasonRM;
use App\Application\ReadModel\Provider as ProviderRM;
use App\Application\ReadModel\Team as TeamRM;
use App\Domain\Entity\League;
use App\Domain\Entity\Provider;
use App\Domain\Entity\Season;
use App\Domain\Entity\Team;
use Doctrine\ORM\EntityManagerInterface;
class FetchLolEsportOfficialAPISchedule
{
const array ENABLED_LEAGUE = [
'98767975604431411', // Worlds
'98767991325878492', // MSI
'113464388705111224', // First Stand
'98767991302996019', // LEC
'100695891328981122', // EMEA Masters
'105266103462388553', // LFL
]; // should not be here
public function __construct(
private readonly LolEsportOfficialAPIEngine $lolEsportOfficialAPIEngine,
private readonly EntityManagerInterface $entityManager,
) {
}
public function __invoke(FetchLolEsportOfficialAPIScheduleRequest $request)
{
// This UseCase can not DELETE, Only INSERT or UPDATE
$provider = $this->entityManager->getRepository(Provider::class)->find(LolEsportOfficialAPIEngine::PROVIDER_ID);
if (null === $provider) {
$provider = new Provider(LolEsportOfficialAPIEngine::PROVIDER_ID);
$provider->create('LolEsportOfficialAPI');
$this->entityManager->persist($provider);
$this->entityManager->flush();
}
$providerRM = $this->entityManager->getRepository(ProviderRM::class)->find(LolEsportOfficialAPIEngine::PROVIDER_ID);
// Fetch Teams, make diff from db, disable if only on db, add if new
// team from api have unique id and code as alias. Match use code to identify teams
$lolEsportOfficialAPITeams = $this->lolEsportOfficialAPIEngine->getTeams();
$teamsRM = $this->entityManager->getRepository(TeamRM::class)->findBy(['providerId' => $providerRM->id]);
$teamsRMWithId = [];
foreach ($teamsRM as $team) {
$teamsRMWithId[$team->providerTeamId] = $team;
}
foreach ($lolEsportOfficialAPITeams as $team) {
if (!isset($teamsRMWithId[$team['id']])) {
// Create Team
$teamEntity = new Team();
$teamEntity->create(
$provider,
$team['id'],
$team['name'],
$team['code'],
'active' === $team['status'],
);
$this->entityManager->persist($teamEntity);
continue;
}
// check for active/renaming?
}
// Fetch League
$lolEsportOfficialAPILeagues = $this->lolEsportOfficialAPIEngine->getLeagues();
$leaguesRM = $this->entityManager->getRepository(LeagueRM::class)->findBy(['providerId' => $providerRM->id]);
$leaguesRMWithId = [];
foreach ($leaguesRM as $league) {
$leaguesRMWithId[$league->providerLeagueId] = $league;
}
foreach ($lolEsportOfficialAPILeagues as $league) {
if (!isset($leaguesRMWithId[$league['id']]) && in_array($league['id'], self::ENABLED_LEAGUE)) {
// Create Team
$leagueEntity = new League();
$leagueEntity->create(
$provider,
$league['id'],
$league['name'],
);
$this->entityManager->persist($leagueEntity);
continue;
}
// check for renaming?
}
// Fetch Season (Tournament). Need to be maped to a league from name if fetch all, can be fetch by league
// add endDate
$seasonsRM = $this->entityManager->getRepository(SeasonRM::class)->findBy(['providerId' => $providerRM->id]);
$seasonsRMWithId = [];
foreach ($seasonsRM as $season) {
$seasonsRMWithId[$season->providerSeasonId] = $season;
}
$leaguesRM = $this->entityManager->getRepository(LeagueRM::class)->findBy(['providerId' => $providerRM->id]);
foreach ($leaguesRM as $league) {
$lolEsportOfficialAPISeason = $this->lolEsportOfficialAPIEngine->getSeasons($league->providerLeagueId);
foreach ($lolEsportOfficialAPISeason as $season) {
if(!isset($seasonsRMWithId[$season['id']])) {
$leagueEntity = $this->entityManager->getRepository(League::class)->find($league->id);
$seasonEntity = new Season();
$seasonEntity->create(
$provider,
$season['id'],
$leagueEntity,
'REG',
(int) (new \DateTimeImmutable($season['endDate']))->format('Y'),
);
$this->entityManager->persist($seasonEntity);
}
}
}
// Fetch Match Schedule
// paginated. can be by league or global
// team are identify by code, not id
$this->entityManager->flush();
}
}

View File

@ -0,0 +1,7 @@
<?php
namespace App\Application\UseCase\LeagueOfLegends;
readonly class FetchLolEsportOfficialAPIScheduleRequest
{
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace App\Application\UseCase;
namespace App\Application\UseCase\NHL;
use App\Application\SportRadar\SportRadarEngine;
use App\Domain\Entity\Game;
@ -12,7 +12,7 @@ use App\Domain\Entity\Team;
use App\Domain\Enum\ENHLSeasonType;
use Doctrine\ORM\EntityManagerInterface;
class FetchNHLMatch
class FetchNHLSportRadarMatch
{
public function __construct(
private readonly SportRadarEngine $sportRadarEngine,
@ -20,11 +20,16 @@ class FetchNHLMatch
) {
}
public function __invoke(FetchNHLMatchRequest $request): void
public function __invoke(FetchNHLSportRadarMatchRequest $request): void
{
$provider =
$this->entityManager->getRepository(Provider::class)->findOneBy(['id' => '885fe581-c4c3-45e7-a06c-29ece7d47fad']) // id should not be here
?? throw new \Exception('Provider not found');
$provider = $this->entityManager->getRepository(Provider::class)->find(SportRadarEngine::PROVIDER_ID);
if (null === $provider) {
$provider = new Provider();
$provider->create('SportRadar');
$this->entityManager->persist($provider);
}
$matchs = $this->sportRadarEngine->getNHLSchedule($request->year, ENHLSeasonType::from($request->type));
$season =

View File

@ -2,9 +2,9 @@
declare(strict_types=1);
namespace App\Application\UseCase;
namespace App\Application\UseCase\NHL;
readonly class FetchNHLMatchRequest
readonly class FetchNHLSportRadarMatchRequest
{
public function __construct(
public int $year,

View File

@ -8,9 +8,9 @@ abstract class AEntity
{
protected string $id;
public function __construct()
public function __construct(?string $id = null)
{
$this->id = $this->generateUUIDv4();
$this->id = $id ?? $this->generateUUIDv4();
}
/**

View File

@ -0,0 +1,24 @@
<?php
namespace App\Infrastructure\Console;
use App\Application\CommandBus\UseCaseCommandBus;
use App\Application\UseCase\LeagueOfLegends\FetchLolEsportOfficialAPIScheduleRequest;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
#[AsCommand(name: 'app:fetch-schedule:lol:lolesport-official-api')]
class FetchLolEsportOfficialAPIScheduleCommand
{
public function __construct(
private readonly UseCaseCommandBus $commandBus,
) {
}
public function __invoke(): int
{
$this->commandBus->ask(new FetchLolEsportOfficialAPIScheduleRequest());
return Command::SUCCESS;
}
}

View File

@ -3,12 +3,12 @@
namespace App\Infrastructure\Console;
use App\Application\CommandBus\UseCaseCommandBus;
use App\Application\UseCase\FetchNHLMatchRequest;
use App\Application\UseCase\NHL\FetchNHLSportRadarMatchRequest;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
#[AsCommand(name: 'app:get-nhl-schedule')]
class GetNHLScheduleCommand
#[AsCommand(name: 'app:fetch-schedule:nhl:sportradar')]
class FetchNHLSportRadarCommand
{
public function __construct(
private readonly UseCaseCommandBus $commandBus,
@ -17,7 +17,7 @@ class GetNHLScheduleCommand
public function __invoke(): int
{
$this->commandBus->ask(new FetchNHLMatchRequest(2025, 'REG'));
$this->commandBus->ask(new FetchNHLSportRadarMatchRequest(2025, 'REG'));
return Command::SUCCESS;
}

View File

@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
namespace App\Infrastructure\LolEsportOfficialAPI;
use App\Application\LolEsportOfficialAPI\LolEsportOfficialAPIEngine;
class FakeLolEsportOfficialAPIEngine implements LolEsportOfficialAPIEngine
{
public function getTeams(): array
{
$fake_lolesport_official_api_lol_teams = json_decode(file_get_contents(__DIR__ . '/Fixtures/lolesport_official_api_lol_teams_21_12_2025.json'), true);
return array_map(fn ($team) => [
"id" => $team["id"],
"slug" => $team["slug"],
"name" => $team["name"],
"code" => $team["code"],
"status" => $team["status"],
], $fake_lolesport_official_api_lol_teams["data"]["teams"]);
}
public function getLeagues(): array
{
$fake_lolesport_official_api_lol_leagues = json_decode(file_get_contents(__DIR__ . '/Fixtures/lolesport_official_api_lol_leagues_21_12_2025.json'), true);
return array_map(fn ($league) => [
'id' => $league['id'],
'slug' => $league['slug'],
'name' => $league['name'],
'region' => $league['region'],
], $fake_lolesport_official_api_lol_leagues['data']['leagues']);
}
public function getSeasons(string $leagueId)
{
$fake_lolesport_official_api_lol_seasons= json_decode(file_get_contents(__DIR__ . '/Fixtures/lolesport_official_api_lol_seasons_02_01_2026.json'), true);
return array_map(fn ($season) => [
'id' => $season['id'],
'slug' => $season['slug'],
'startDate' => $season['startDate'],
'endDate' => $season['endDate'],
], $fake_lolesport_official_api_lol_seasons['data']['leagues'][$leagueId]['tournaments'] ?? throw new \Exception('league id not found'));
}
public function getSchedules()
{
// TODO: Implement getSchedules() method.
}
}

View File

@ -0,0 +1,486 @@
{
"data": {
"leagues": [
{
"id": "98767975604431411",
"slug": "worlds",
"name": "Worlds",
"region": "INTERNATIONAL",
"image": "http://static.lolesports.com/leagues/1592594612171_WorldsDarkBG.png",
"priority": 1,
"displayPriority": {
"position": 0,
"status": "force_selected"
}
},
{
"id": "98767991325878492",
"slug": "msi",
"name": "MSI",
"region": "INTERNATIONAL",
"image": "http://static.lolesports.com/leagues/1592594634248_MSIDarkBG.png",
"priority": 1,
"displayPriority": {
"position": 1,
"status": "force_selected"
}
},
{
"id": "113464388705111224",
"slug": "first_stand",
"name": "First Stand",
"region": "INTERNATIONAL",
"image": "http://static.lolesports.com/leagues/1740042025201_RG_LOL_FIRST_STAND_LOGO_VOLT_ALPHA.png",
"priority": 1,
"displayPriority": {
"position": 2,
"status": "force_selected"
}
},
{
"id": "98767991299243165",
"slug": "lcs",
"name": "LCS",
"region": "NORTH AMERICA",
"image": "http://static.lolesports.com/leagues/1706356907418_LCSNew-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 0,
"status": "selected"
}
},
{
"id": "98767991332355509",
"slug": "cblol-brazil",
"name": "CBLOL",
"region": "BRAZIL",
"image": "http://static.lolesports.com/leagues/cblol-logo-symbol-offwhite.png",
"priority": 1,
"displayPriority": {
"position": 1,
"status": "selected"
}
},
{
"id": "98767991302996019",
"slug": "lec",
"name": "LEC",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1592516184297_LEC-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 2,
"status": "selected"
}
},
{
"id": "98767991310872058",
"slug": "lck",
"name": "LCK",
"region": "KOREA",
"image": "http://static.lolesports.com/leagues/lck-color-on-black.png",
"priority": 1,
"displayPriority": {
"position": 0,
"status": "not_selected"
}
},
{
"id": "98767991314006698",
"slug": "lpl",
"name": "LPL",
"region": "CHINA",
"image": "http://static.lolesports.com/leagues/1592516115322_LPL-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 1,
"status": "not_selected"
}
},
{
"id": "113476371197627891",
"slug": "lcp",
"name": "LCP",
"region": "PACIFIC",
"image": "http://static.lolesports.com/leagues/1733468139601_lcp-color-golden.png",
"priority": 1,
"displayPriority": {
"position": 2,
"status": "not_selected"
}
},
{
"id": "109511549831443335",
"slug": "nacl",
"name": "NACL",
"region": "NORTH AMERICA",
"image": "http://static.lolesports.com/leagues/1740390007442_FULL_COLOR_FOR_DARK_BG.png",
"priority": 1,
"displayPriority": {
"position": 3,
"status": "not_selected"
}
},
{
"id": "100695891328981122",
"slug": "emea_masters",
"name": "EMEA Masters",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1669375535108_EM_Icon_Green1.png",
"priority": 1,
"displayPriority": {
"position": 4,
"status": "not_selected"
}
},
{
"id": "98767991349978712",
"slug": "ljl-japan",
"name": "LJL",
"region": "JAPAN",
"image": "http://static.lolesports.com/leagues/1733997208721_LJL_icon_white_724px.png",
"priority": 1,
"displayPriority": {
"position": 5,
"status": "not_selected"
}
},
{
"id": "98767991343597634",
"slug": "turkiye-sampiyonluk-ligi",
"name": "TCL",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1738338347640_ampiyonlukLigi-AMBLEM.png",
"priority": 1,
"displayPriority": {
"position": 6,
"status": "not_selected"
}
},
{
"id": "105266098308571975",
"slug": "nlc",
"name": "NLC",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1641490922073_nlc_logo.png",
"priority": 1,
"displayPriority": {
"position": 7,
"status": "not_selected"
}
},
{
"id": "105266103462388553",
"slug": "lfl",
"name": "La Ligue Française",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/LFL_Logo_2020_black1.png",
"priority": 1,
"displayPriority": {
"position": 8,
"status": "not_selected"
}
},
{
"id": "107407335299756365",
"slug": "roadoflegends",
"name": "Road of Legends",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1737450944766_ROL_DARKBG.png",
"priority": 1,
"displayPriority": {
"position": 9,
"status": "not_selected"
}
},
{
"id": "105266101075764040",
"slug": "liga_portuguesa",
"name": "Liga Portuguesa",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1649884876085_LPLOL_2021_ISO_G-c389e9ae85c243e4f76a8028bbd9ca1609c2d12bc47c3709a9250d1b3ca43f58.png",
"priority": 1,
"displayPriority": {
"position": 10,
"status": "not_selected"
}
},
{
"id": "105266094998946936",
"slug": "lit",
"name": "LoL Italian Tournament",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1703058345246_IMG_4673.png",
"priority": 1,
"displayPriority": {
"position": 11,
"status": "not_selected"
}
},
{
"id": "113673877956508505",
"slug": "rift_legends",
"name": "Rift Legends",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1736963779891_Logo_short_lightRL__.png",
"priority": 1,
"displayPriority": {
"position": 12,
"status": "not_selected"
}
},
{
"id": "105266074488398661",
"slug": "superliga",
"name": "SuperLiga",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/SL21-V-white.png",
"priority": 1,
"displayPriority": {
"position": 13,
"status": "not_selected"
}
},
{
"id": "105266091639104326",
"slug": "primeleague",
"name": "Prime League",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/PrimeLeagueResized.png",
"priority": 1,
"displayPriority": {
"position": 14,
"status": "not_selected"
}
},
{
"id": "105266106309666619",
"slug": "hitpoint_masters",
"name": "Hitpoint Masters",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1641465237186_HM_white.png",
"priority": 1,
"displayPriority": {
"position": 15,
"status": "not_selected"
}
},
{
"id": "105266111679554379",
"slug": "esports_balkan_league",
"name": "Esports Balkan League",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1625735031226_ebl_crest-whitePNG.png",
"priority": 1,
"displayPriority": {
"position": 16,
"status": "not_selected"
}
},
{
"id": "105266108767593290",
"slug": "hellenic_legends_league",
"name": "Hellenic Legends League",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1736361775356_HLL_FULL_COLOUR_DARKBG.png",
"priority": 1,
"displayPriority": {
"position": 17,
"status": "not_selected"
}
},
{
"id": "109545772895506419",
"slug": "arabian_league",
"name": "Arabian League",
"region": "EMEA",
"image": "http://static.lolesports.com/leagues/1738573749768_GoldAL.png",
"priority": 1,
"displayPriority": {
"position": 18,
"status": "not_selected"
}
},
{
"id": "98767991335774713",
"slug": "lck_challengers_league",
"name": "LCK Challengers",
"region": "KOREA",
"image": "http://static.lolesports.com/leagues/lck-cl-white.png",
"priority": 1,
"displayPriority": {
"position": 19,
"status": "not_selected"
}
},
{
"id": "105549980953490846",
"slug": "cd",
"name": "Circuito Desafiante",
"region": "BRAZIL",
"image": "http://static.lolesports.com/leagues/1739883216140_CIRCUITO_DESAFIANTE_COLOR_ORANGE.png",
"priority": 1,
"displayPriority": {
"position": 20,
"status": "not_selected"
}
},
{
"id": "104366947889790212",
"slug": "pcs",
"name": "PCS",
"region": "HONG KONG, MACAU, TAIWAN",
"image": "http://static.lolesports.com/leagues/1592515942679_PCS-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 21,
"status": "not_selected"
}
},
{
"id": "110371976858004491",
"slug": "north_regional_league",
"name": "LRN",
"region": "LATIN AMERICA NORTH",
"image": "http://static.lolesports.com/leagues/1742461971444_FULL_COLOR_FOR_DARK_BG1.png",
"priority": 1,
"displayPriority": {
"position": 22,
"status": "not_selected"
}
},
{
"id": "110372322609949919",
"slug": "south_regional_league",
"name": "LRS",
"region": "LATIN AMERICA SOUTH",
"image": "http://static.lolesports.com/leagues/1742460115671_FULL_COLOR_FOR_DARK_BG.png",
"priority": 1,
"displayPriority": {
"position": 23,
"status": "not_selected"
}
},
{
"id": "108001239847565215",
"slug": "tft_esports",
"name": "TFT Esports ",
"region": "INTERNATIONAL",
"image": "http://static.lolesports.com/leagues/1723029828764_TFT_GRADIENT_2.png",
"priority": 1,
"displayPriority": {
"position": 24,
"status": "not_selected"
}
},
{
"id": "113475149040947852",
"slug": "lta_cross",
"name": "LTA Cross-Conference",
"region": "AMERICAS",
"image": "http://static.lolesports.com/leagues/1731566966819_LTA-LOGO-LightGold_RGB2000px.png",
"priority": 1,
"displayPriority": {
"position": 4,
"status": "hidden"
}
},
{
"id": "101382741235120470",
"slug": "lla",
"name": "LLA",
"region": "LATIN AMERICA",
"image": "http://static.lolesports.com/leagues/1592516315279_LLA-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 6,
"status": "hidden"
}
},
{
"id": "105709090213554609",
"slug": "lco",
"name": "LCO",
"region": "OCEANIA",
"image": "http://static.lolesports.com/leagues/lco-color-white.png",
"priority": 1,
"displayPriority": {
"position": 18,
"status": "hidden"
}
},
{
"id": "107213827295848783",
"slug": "vcs",
"name": "VCS",
"region": "VIETNAM",
"image": "http://static.lolesports.com/leagues/1677578094811_VCS_SYMBOL_TITANIUM_RGB.png",
"priority": 1,
"displayPriority": {
"position": 20,
"status": "hidden"
}
},
{
"id": "110988878756156222",
"slug": "wqs",
"name": "Worlds Qualifying Series",
"region": "INTERNATIONAL",
"image": "http://static.lolesports.com/leagues/1693555886600_lolesports_icon_ice-01.png",
"priority": 1,
"displayPriority": {
"position": 30,
"status": "hidden"
}
},
{
"id": "111102022734849553",
"slug": "duelo_de_reyes",
"name": "King's Duel",
"region": "LATIN AMERICA",
"image": "http://static.lolesports.com/leagues/1695282324552_B.png",
"priority": 1,
"displayPriority": {
"position": 58,
"status": "hidden"
}
},
{
"id": "113470291645289904",
"slug": "lta_n",
"name": "LTA North",
"region": "AMERICAS",
"image": "http://static.lolesports.com/leagues/1731566778368_LTANORTH-LOGO_Blue_RGB2000px.png",
"priority": 1,
"displayPriority": {
"position": 63,
"status": "hidden"
}
},
{
"id": "113475181634818701",
"slug": "lta_s",
"name": "LTA South",
"region": "AMERICAS",
"image": "http://static.lolesports.com/leagues/1731566868757_LTASOUTH-LOGO_Red_RGB2000px.png",
"priority": 1,
"displayPriority": {
"position": 64,
"status": "hidden"
}
},
{
"id": "98767991355908944",
"slug": "lcl",
"name": "LCL",
"region": "COMMONWEALTH OF INDEPENDENT STATES",
"image": "http://static.lolesports.com/leagues/1593016885758_LCL-01-FullonDark.png",
"priority": 1,
"displayPriority": {
"position": 97,
"status": "hidden"
}
}
]
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Infrastructure\LolEsportOfficialAPI;
use App\Application\LolEsportOfficialAPI\LolEsportOfficialAPIEngine;
class HTTPLolEsportOfficialAPIEngine implements LolEsportOfficialAPIEngine
{
public function getTeams()
{
// TODO: Implement getTeams() method.
}
public function getLeagues()
{
// TODO: Implement getLeagues() method.
}
public function getSeasons(string $leagueId)
{
// TODO: Implement getSeasons() method.
}
public function getSchedules()
{
// TODO: Implement getSchedules() method.
}
}

View File

@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
$builder = new Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder($metadata);
$builder
->setReadOnly()
->setTable('league')
;
$builder
->createField('id', 'uuid')
->nullable(false)
->makePrimaryKey()
->build();
$builder
->createField('providerId', 'uuid')
->columnName('provider_id')
->nullable(false)
->build();
$builder
->createField('providerLeagueId', 'string')
->columnName('provider_league_id')
->nullable(false)
->build();
$builder
->createField('name', 'string')
->nullable(false)
->build();

View File

@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
$builder = new Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder($metadata);
$builder
->setReadOnly()
->setTable('season')
;
$builder
->createField('id', 'uuid')
->nullable(false)
->makePrimaryKey()
->build();
$builder
->createField('providerId', 'uuid')
->columnName('provider_id')
->nullable(false)
->build();
$builder
->createField('providerSeasonId', 'string')
->columnName('provider_season_id')
->nullable(false)
->build();
$builder
->createField('year', 'integer')
->nullable(false)
->build();
$builder
->createField('kind', 'string')
->nullable(false)
->build();
$builder
->createField('leagueId', 'string')
->columnName('league_id')
->nullable(false)
->build();

View File

@ -15,11 +15,16 @@ $builder
->build();
$builder
->createField('providerLeagueId', 'uuid')
->createField('providerLeagueId', 'string')
->columnName('provider_league_id')
->nullable(false)
->build();
$builder
->createField('name', 'string')
->nullable(false)
->build();
$builder
->createManyToOne('provider', 'App\\Domain\\Entity\\Provider')
->addJoinColumn('provider_id', 'id', false, false, 'CASCADE')

View File

@ -15,7 +15,7 @@ $builder
->build();
$builder
->createField('providerSeasonId', 'uuid')
->createField('providerSeasonId', 'string')
->columnName('provider_season_id')
->nullable(false)
->build();

View File

@ -15,7 +15,7 @@ $builder
->build();
$builder
->createField('providerTeamId', 'uuid')
->createField('providerTeamId', 'string')
->columnName('provider_team_id')
->nullable(false)
->build();