$formData Current form data (unused) * * @return bool True if fields should be shown as static text (read-only) */ public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool { // This condition only applies to the first participant. // Non-first participants: return false here, but may still be read-only via PersonalDataMutabilityCondition if (0 !== $participantIndex) { return false; } // participant[0] is a traveller in their own right: nothing to protect here. if (false === $bookingDto->isFirstParticipantApplicant()) { return false; } if (BookingDto::MODE_CREATE === $bookingDto->getMode()) { // Anonymous user (no personId) = must fill in data = editable return null !== $bookingDto->getParticipant($participantIndex)?->personId; } // EDIT mode: participant[0] is the applicant, whose record is owned by the account. return true; } /** * Returns field names that this condition depends on. * * This condition is based on the applicant split and personId, which are set during * initialization and don't change during form interaction, so no field dependencies. * * @return string[] Empty array - no field dependencies */ public function getDependentFields(): array { return []; } /** * Returns a human-readable description of this condition. * * @return string Description of the first participant read-only logic */ public function getDescription(): string { return 'First participant personal data is read-only when they are also the applicant'; } }