getParticipant($bookingDto, $participantIndex); if (null === $participant) { return; } // Pickup applies only to outbound bus journey - clear when outbound is not bus $hasOutboundBus = null !== $participant->transportationOutbound && DirectionMapper::SUBTYPE_BUS_API === $participant->transportationOutbound->subType; if (false === $hasOutboundBus) { $participant->pickup = null; return; } $selectedPickup = $this->getFieldValue($submittedData, $this->getFieldName()); // Validate pickup selection against available outbound pickups $participant->pickup = $this->findItemById($selectedPickup, $bookingDto->travel->pickups); } }