rentals)) { return; } if (empty($this->height)) { $context->buildViolation('Bitte angeben wegen Leihmaterial') ->atPath('height') ->addViolation() ; } if (empty($this->shoeSize)) { $context->buildViolation('Bitte angeben wegen Leihmaterial') ->atPath('shoeSize') ->addViolation() ; } if (empty($this->weight)) { $context->buildViolation('Bitte angeben wegen Leihmaterial') ->atPath('weight') ->addViolation() ; } } #[Assert\Callback] public function assertPickupSelected(ExecutionContextInterface $context): void { if (null !== $this->transportationServiceTo && null === $this->pickupTo) { $context->buildViolation('Bitte auswählen') ->atPath('pickupTo') ->addViolation() ; } if (null !== $this->transportationServiceFro && null === $this->pickupFro) { $context->buildViolation('Bitte auswählen') ->atPath('pickupFro') ->addViolation() ; } } public static function fromPersonalData(PersonalData $personalData): static { $instance = new static(); $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; } }