Add teams to response
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good

This commit is contained in:
2024-07-25 02:04:46 +02:00
parent 58eb6141a8
commit 442e3e3248
2 changed files with 19 additions and 9 deletions
+6
View File
@@ -30,9 +30,14 @@ class SeasonDto
public function createSeasonArray(): array
{
$numberOfTeams = $this->numberOfTeams ?? 0;
$teamList = [];
if (!empty($this->teamDtoList))
{
$numberOfTeams = count($this->teamDtoList);
foreach ($this->teamDtoList as $teamDto)
{
$teamList[] = $teamDto->toArray();
}
}
return [
'id' => $this->id ?? null,
@@ -42,6 +47,7 @@ class SeasonDto
'dateStart' => !empty($this->dateStart) ? $this->dateStart->format('Y-m-d'): null,
'leagueId' => $this->leagueId ?? null,
'leagueName' => $this->leagueName ?? null,
'teams' => $teamList,
'pointsPerWin' => $this->pointsPerWin ?? null,
'pointsPerDraw' => $this->pointsPerDraw ?? null,
'pointsPerLoss' => $this->pointsPerLoss ?? null,