$formData Current form data (unused) * * @return bool True if fields should be shown as static text */ public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool { $participant = $bookingDto->getParticipant($participantIndex); if (null === $participant) { return false; } // In edit mode, compare participant's personId with applicant's personId // This distinguishes customer-initiated (match) from agency-initiated (no match) bookings if (BookingDto::MODE_EDIT === $bookingDto->getMode()) { $applicantPersonId = $bookingDto->booking?->applicant?->personId; if (null === $applicantPersonId) { return false; } return $participant->personId === $applicantPersonId; } // In create mode, check if participant has personId (prepopulated from BPN account) return null !== $participant->personId; } /** * Returns field names that this condition depends on. * * This condition is based on personId which is set during prepopulation * and doesn'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 authenticated user personal data protection logic */ public function getDescription(): string { return 'Personal data is shown as static text for the logged-in user (edit via personal data form)'; } }