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('last_name', $properties)) { $flightBooking->setLastName($properties['last_name']); } if (array_key_exists('flight_date', $properties)) { $flightBooking->setFlightDate($properties['flight_date']); } }
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('last_name', $properties)) { $flightBooking->setLastName($properties['last_name']); } // if(array_key_exists('flight_date', $properties)){ // $formattedDate = $properties['flight_date']; // $flightDate = self::createDateTime($formattedDate); // if ($flightDate) { // $flightBooking->setDate($flightDate); // } // } }