Create Facility
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good

This commit is contained in:
Daniel Guzman
2024-06-08 23:00:17 +02:00
parent 33980dbb46
commit 08a43cb760
8 changed files with 83 additions and 78 deletions
+1 -9
View File
@@ -18,16 +18,8 @@ class FacilityDto
public \DateTimeImmutable $createdAt;
public array $validationErrors;
public function toArray(): array
public function createFacilityArray(): array
{
$seasonList = [];
if (!empty($this->seasonDtoList))
{
foreach ($this->seasonDtoList as $seasonDto)
{
$seasonList = $seasonDto->toArray();
}
}
return [
'id' => $this->id ?? '',
'name' => $this->name ?? '',
+1 -1
View File
@@ -32,7 +32,7 @@ class GameDto
'gameDateTime' => !empty($this->gameDateTime) ? $this->gameDateTime->format('Y-m-d H:i:s') : null,
'season' => $this->seasonDto->createSeasonArray() ?? [],
'notes' => $this->notes ?? null,
'facility' => $this->facilityDto->toArray() ?? [],
'facility' => $this->facilityDto->createFacilityArray() ?? [],
'pointsHome' => $this->pointsHome ?? 0,
'pointsAway' => $this->pointsAway ?? 0,
'createdAt' => !empty($this->createdAt) ? $this->createdAt->format('Y-m-d H:i:s') : null,