コード例 #1
0
 public function handle(Command $command)
 {
     $reservation = Reservation::take($command->reservationId, $command->restaurantId, $command->customerId, $command->numPeople, $command->dateTime);
     $this->repository->save($reservation);
 }
コード例 #2
0
 public static function take(ReservationId $reservationId, RestaurantId $restaurantId, CustomerId $customerId, $numPeople, \DateTime $dateTime)
 {
     $reservation = new Reservation();
     $reservation->recordThat(new ReservationWasTaken(['reservationId' => $reservationId, 'restaurantId' => $restaurantId, 'customerId' => $customerId, 'numPeople' => $numPeople, 'dateTime' => $dateTime]));
     return $reservation;
 }