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']); } }
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); } } }