Пример #1
0
 public static function map(FlightBooking $flightBooking, array $properties)
 {
     if (array_key_exists('id', $properties)) {
         $flightBooking->setId($properties['id']);
     }
     if (array_key_exists('first_name', $properties)) {
         $flightBooking->setFirstName($properties['first_name']);
     }
     if (array_key_exists('no_of_passengers', $properties)) {
         $flightBooking->setNoOfPassengers($properties['no_of_passengers']);
     }
 }
Пример #2
0
 public static function map(FlightBooking $flightBooking, array $properties)
 {
     if (array_key_exists('id', $properties)) {
         $flightBooking->setId($properties['id']);
     }
     if (array_key_exists('first_name', $properties)) {
         $flightBooking->setFirstName($properties['first_name']);
     }
     if (array_key_exists('no_of_passengers', $properties)) {
         $flightBooking->setNoOfPassengers($properties['no_of_passengers']);
     }
     if (array_key_exists('date', $properties)) {
         $formattedDate = $properties['date'];
         $date = self::createDateTime($formattedDate);
         if ($date) {
             $flightBooking->setDate($date);
         }
     }
 }