defaultValue = $defaultValue; $this->limitMaxLength = $limitMaxLength; $this->maxLength = $maxLength; $this->labelPosition = $labelPosition; $this->noDuplicates = $noDuplicates; $this->inputPrefix = $inputPrefix; $this->inputSuffix = $inputSuffix; $this->ratingIcon = $ratingIcon; $this->fileUploadSettings = $fileUploadSettings; } /** * Get the default value. * * @return string */ public function getDefaultValue(): string { return $this->defaultValue; } /** * Set the default value. * * @param string $defaultValue */ public function setDefaultValue(string $defaultValue): void { $this->defaultValue = $defaultValue; } /** * Check if maximum length limit is enabled. * * @return bool */ public function isLimitMaxLength(): bool { return $this->limitMaxLength; } /** * Set the limit maximum length setting. * * @param bool $limitMaxLength */ public function setLimitMaxLength(bool $limitMaxLength): void { $this->limitMaxLength = $limitMaxLength; } /** * Get the maximum length. * * @return int */ public function getMaxLength(): int { return $this->maxLength; } /** * Set the maximum length setting. * * @param int $maxLength */ public function setMaxLength(int $maxLength): void { $this->maxLength = $maxLength; } /** * Get the label position. * * @return string */ public function getLabelPosition(): string { return $this->labelPosition; } /** * Set the label position setting. * * @param string $labelPosition */ public function setLabelPosition(string $labelPosition): void { $this->labelPosition = $labelPosition; } /** * Check if duplicates are not allowed. * * @return bool */ public function isNoDuplicates(): bool { return $this->noDuplicates; } /** * Set the noDuplicates setting. * * @param bool $noDuplicates */ public function setNoDuplicates(bool $noDuplicates): void { $this->noDuplicates = $noDuplicates; } /** * Get the field prefix. * * @return string */ public function getInputPrefix(): string { return $this->inputPrefix; } /** * Set the field prefix. * * @param string $prefix */ public function setInputPrefix(string $prefix): void { $this->inputPrefix = $prefix; } /** * Get the field suffix. * * @return string */ public function getInputSuffix(): string { return $this->inputSuffix; } /** * Set the field suffix. * * @param string $suffix */ public function setInputSuffix(string $suffix): void { $this->inputSuffix = $suffix; } /** * Get the rating icon type. * * @return string */ public function getRatingIcon(): string { return $this->ratingIcon; } /** * Set the rating icon type. * * @param string $ratingIcon */ public function setRatingIcon(string $ratingIcon): void { $this->ratingIcon = $ratingIcon; } public function getFileUploadSettings(): FileUploadFieldAdvancedSettings { return $this->fileUploadSettings; } /** * Maximum file size in MB for file-upload fields (0 = server default). */ public function getMaxFileSizeMb(): int { return $this->fileUploadSettings->getMaxFileSizeMb(); } public function setMaxFileSizeMb(int $maxFileSizeMb): void { $this->fileUploadSettings->setMaxFileSizeMb($maxFileSizeMb); } /** * Target storage for uploads: ivyforms or media_library. */ public function getSaveUploadsTo(): string { return $this->fileUploadSettings->getSaveUploadsTo(); } public function setSaveUploadsTo(string $saveUploadsTo): void { $this->fileUploadSettings->setSaveUploadsTo($saveUploadsTo); } /** * @return array */ public function getAllowedFileExtensions(): array { return $this->fileUploadSettings->getAllowedFileExtensions(); } /** * @param array $allowedFileExtensions */ public function setAllowedFileExtensions(array $allowedFileExtensions): void { $this->fileUploadSettings->setAllowedFileExtensions($allowedFileExtensions); } /** * Convert the advanced settings to an array. * * @return array */ public function toArray(): array { return array_merge( [ 'defaultValue' => $this->getDefaultValue(), 'limitMaxLength' => $this->isLimitMaxLength(), 'maxLength' => $this->getMaxLength(), 'labelPosition' => $this->getLabelPosition(), 'noDuplicates' => $this->isNoDuplicates(), 'inputPrefix' => $this->getInputPrefix(), 'inputSuffix' => $this->getInputSuffix(), 'ratingIcon' => $this->getRatingIcon(), ], $this->fileUploadSettings->toArray() ); } }