This commit is contained in:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user