wip: refactor
This commit is contained in:
@@ -5,7 +5,7 @@ namespace App\Form\Model;
|
||||
use App\BusProNet\Model\Travel;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class BookingCreateDto
|
||||
class BookingCreateDto implements BookingDtoInterface
|
||||
{
|
||||
public int $currentStep = 1;
|
||||
|
||||
@@ -21,7 +21,7 @@ class BookingCreateDto
|
||||
#[Assert\Valid]
|
||||
public array $participants = [];
|
||||
|
||||
public function __construct(public Travel $travelData, public int $hotelId)
|
||||
public function __construct(public Travel $travel, public int $hotelId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,4 +34,24 @@ class BookingCreateDto
|
||||
return 0 < $roomSelection->quantity;
|
||||
});
|
||||
}
|
||||
|
||||
public function getParticipants(): array
|
||||
{
|
||||
return $this->participants;
|
||||
}
|
||||
|
||||
public function getTravel(): Travel
|
||||
{
|
||||
return $this->travel;
|
||||
}
|
||||
|
||||
public function hasParticipant(int $index): bool
|
||||
{
|
||||
return isset($this->participants[$index]);
|
||||
}
|
||||
|
||||
public function getParticipant(int $index): ?ParticipantDto
|
||||
{
|
||||
return $this->participants[$index] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user