status = $personalData->status; $instance->addressId = $personalData->addressId; $instance->personId = $personalData->personId; $instance->mutable = $personalData->mutable; $instance->firstName = $personalData->firstName; $instance->lastName = $personalData->name; $instance->gender = $personalData->gender; $instance->nationality = $personalData->nationality; $instance->email = $personalData->communication?->email; $instance->mobile = $personalData->communication?->mobile; $instance->dateOfBirth = $personalData->dateOfBirth; $instance->height = $personalData->height; $instance->weight = $personalData->weight; $instance->shoeSize = $personalData->shoeSize; return $instance; } public function isCanceled(): bool { return 'S' === $this->status; } public function isOption(): bool { return 'O' === $this->status; } /** * Validates that body dimension fields are provided when rental services are selected. * * This callback validator ensures that height, weight, and shoe size are mandatory * when the participant has selected any rental services. This is required for * proper equipment sizing and rental fulfillment. * * @param ExecutionContextInterface $context The validation context */ public function validateBodyDimensionsForRentals(ExecutionContextInterface $context): void { $rentals = $this->rentals ?? []; // If no rental services are selected, body dimensions are not required if (empty($rentals)) { return; } // Validate height field if (true === empty($this->height)) { $context->buildViolation('Deine Körpergröße ist erforderlich wenn Leihmaterial ausgewählt wurde') ->atPath('height') ->addViolation(); } // Validate weight field if (true === empty($this->weight)) { $context->buildViolation('Dein Gewicht ist erforderlich wenn Leihmaterial ausgewählt wurde') ->atPath('weight') ->addViolation(); } // Validate shoe size field if (true === empty($this->shoeSize)) { $context->buildViolation('Deine Schuhgröße ist erforderlich wenn Leihmaterial ausgewählt wurde') ->atPath('shoeSize') ->addViolation(); } } }