| @@ -1,0 +1,336 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace IvyForms\Entity\Field; | |
| 4 | + | |
| 5 | +use IvyForms\ValueObjects\Field\FieldGeneralSettings as FieldGeneralSettingsVO; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Class FieldGeneralSettings | |
| 9 | + * | |
| 10 | + * Entity wrapper for FieldGeneralSettings ValueObject. | |
| 11 | + */ | |
| 12 | +class FieldGeneralSettings | |
| 13 | +{ | |
| 14 | + private FieldGeneralSettingsVO $fieldGeneralSettings; | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * @param FieldGeneralSettingsVO $fieldGeneralSettings | |
| 18 | + */ | |
| 19 | + public function __construct(FieldGeneralSettingsVO $fieldGeneralSettings) | |
| 20 | + { | |
| 21 | + $this->fieldGeneralSettings = $fieldGeneralSettings; | |
| 22 | + } | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * @return string | |
| 26 | + */ | |
| 27 | + public function getLabel(): string | |
| 28 | + { | |
| 29 | + return $this->fieldGeneralSettings->getLabel(); | |
| 30 | + } | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * @return bool | |
| 34 | + */ | |
| 35 | + public function isRequired(): bool | |
| 36 | + { | |
| 37 | + return $this->fieldGeneralSettings->isRequired(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * @return string | |
| 42 | + */ | |
| 43 | + public function getPlaceholder(): string | |
| 44 | + { | |
| 45 | + return $this->fieldGeneralSettings->getPlaceholder(); | |
| 46 | + } | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * @return bool | |
| 50 | + */ | |
| 51 | + public function isHideLabel(): bool | |
| 52 | + { | |
| 53 | + return $this->fieldGeneralSettings->isHideLabel(); | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * @return bool | |
| 58 | + */ | |
| 59 | + public function isReadOnly(): bool | |
| 60 | + { | |
| 61 | + return $this->fieldGeneralSettings->isReadOnly(); | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * @return string | |
| 66 | + */ | |
| 67 | + public function getDescription(): string | |
| 68 | + { | |
| 69 | + return $this->fieldGeneralSettings->getDescription(); | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * @return string | |
| 74 | + */ | |
| 75 | + public function getRequiredMessage(): string | |
| 76 | + { | |
| 77 | + return $this->fieldGeneralSettings->getRequiredMessage(); | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * @return string | |
| 82 | + */ | |
| 83 | + public function getCssClasses(): string | |
| 84 | + { | |
| 85 | + return $this->fieldGeneralSettings->getCssClasses(); | |
| 86 | + } | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * @return bool | |
| 90 | + */ | |
| 91 | + public function isShuffleOptions(): bool | |
| 92 | + { | |
| 93 | + return $this->fieldGeneralSettings->isShuffleOptions(); | |
| 94 | + } | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * @return bool | |
| 98 | + */ | |
| 99 | + public function isShowValues(): bool | |
| 100 | + { | |
| 101 | + return $this->fieldGeneralSettings->isShowValues(); | |
| 102 | + } | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * @return bool | |
| 106 | + */ | |
| 107 | + public function isEnableSearch(): bool | |
| 108 | + { | |
| 109 | + return $this->fieldGeneralSettings->isEnableSearch(); | |
| 110 | + } | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * @return bool | |
| 114 | + */ | |
| 115 | + public function isVisible(): bool | |
| 116 | + { | |
| 117 | + return $this->fieldGeneralSettings->isVisible(); | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * Get the phone format of the form field. | |
| 122 | + * | |
| 123 | + * @return string The phone format of the form field. | |
| 124 | + */ | |
| 125 | + public function getPhoneFormat(): string | |
| 126 | + { | |
| 127 | + return $this->fieldGeneralSettings->getPhoneFormat(); | |
| 128 | + } | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * Set the phone format of the form field. | |
| 132 | + * | |
| 133 | + * @param string $format The phone format to set. | |
| 134 | + */ | |
| 135 | + public function setPhoneFormat(string $format): void | |
| 136 | + { | |
| 137 | + $this->fieldGeneralSettings->setPhoneFormat($format); | |
| 138 | + } | |
| 139 | + /** | |
| 140 | + * Get minimum value constraint. | |
| 141 | + * | |
| 142 | + * @return float|null | |
| 143 | + */ | |
| 144 | + public function getMinValue(): ?float | |
| 145 | + { | |
| 146 | + return $this->fieldGeneralSettings->getMinValue(); | |
| 147 | + } | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * Set minimum value constraint. | |
| 151 | + * | |
| 152 | + * @param float|null $minValue | |
| 153 | + */ | |
| 154 | + public function setMinValue(?float $minValue): void | |
| 155 | + { | |
| 156 | + $this->fieldGeneralSettings->setMinValue($minValue); | |
| 157 | + } | |
| 158 | + | |
| 159 | + /** | |
| 160 | + * Get maximum value constraint. | |
| 161 | + * | |
| 162 | + * @return float|null | |
| 163 | + */ | |
| 164 | + public function getMaxValue(): ?float | |
| 165 | + { | |
| 166 | + return $this->fieldGeneralSettings->getMaxValue(); | |
| 167 | + } | |
| 168 | + | |
| 169 | + /** | |
| 170 | + * Set maximum value constraint. | |
| 171 | + * | |
| 172 | + * @param float|null $maxValue | |
| 173 | + */ | |
| 174 | + public function setMaxValue(?float $maxValue): void | |
| 175 | + { | |
| 176 | + $this->fieldGeneralSettings->setMaxValue($maxValue); | |
| 177 | + } | |
| 178 | + | |
| 179 | + /** | |
| 180 | + * Get step increment. | |
| 181 | + * @return float | |
| 182 | + */ | |
| 183 | + public function getStep(): float | |
| 184 | + { | |
| 185 | + return $this->fieldGeneralSettings->getStep(); | |
| 186 | + } | |
| 187 | + | |
| 188 | + /** | |
| 189 | + * Set step value. | |
| 190 | + * @param float $step | |
| 191 | + */ | |
| 192 | + public function setStep(float $step): void | |
| 193 | + { | |
| 194 | + $this->fieldGeneralSettings->setStep($step); | |
| 195 | + } | |
| 196 | + | |
| 197 | + /** | |
| 198 | + * Get show grid value. | |
| 199 | + * @return bool | |
| 200 | + */ | |
| 201 | + public function getShowGrid(): bool | |
| 202 | + { | |
| 203 | + return $this->fieldGeneralSettings->getShowGrid(); | |
| 204 | + } | |
| 205 | + | |
| 206 | + /** | |
| 207 | + * Set show grid value. | |
| 208 | + * @param bool $showGrid | |
| 209 | + */ | |
| 210 | + public function setShowGrid(bool $showGrid): void | |
| 211 | + { | |
| 212 | + $this->fieldGeneralSettings->setShowGrid($showGrid); | |
| 213 | + } | |
| 214 | + | |
| 215 | + /** | |
| 216 | + * Get number format key. | |
| 217 | + * @return string | |
| 218 | + */ | |
| 219 | + public function getNumberFormat(): string | |
| 220 | + { | |
| 221 | + return $this->fieldGeneralSettings->getNumberFormat(); | |
| 222 | + } | |
| 223 | + | |
| 224 | + /** | |
| 225 | + * Set number format key. | |
| 226 | + * @param string $numberFormat | |
| 227 | + */ | |
| 228 | + public function setNumberFormat(string $numberFormat): void | |
| 229 | + { | |
| 230 | + $this->fieldGeneralSettings->setNumberFormat($numberFormat); | |
| 231 | + } | |
| 232 | + | |
| 233 | + /** | |
| 234 | + * Get the phone auto-detect status of the form field. | |
| 235 | + * | |
| 236 | + * @return bool The phone auto-detect status of the form field. | |
| 237 | + */ | |
| 238 | + public function isPhoneAutoDetect(): bool | |
| 239 | + { | |
| 240 | + return $this->fieldGeneralSettings->isPhoneAutoDetect(); | |
| 241 | + } | |
| 242 | + | |
| 243 | + /** | |
| 244 | + * Set the phone auto-detect status of the form field. | |
| 245 | + * | |
| 246 | + * @param bool $val The phone auto-detect status to set. | |
| 247 | + */ | |
| 248 | + public function setPhoneAutoDetect(bool $val): void | |
| 249 | + { | |
| 250 | + $this->fieldGeneralSettings->setPhoneAutoDetect($val); | |
| 251 | + } | |
| 252 | + | |
| 253 | + /** | |
| 254 | + * Get the HTML content of the form field. | |
| 255 | + * | |
| 256 | + * @return string The HTML content. | |
| 257 | + */ | |
| 258 | + public function getHtmlContent(): string | |
| 259 | + { | |
| 260 | + return $this->fieldGeneralSettings->getHtmlContent(); | |
| 261 | + } | |
| 262 | + | |
| 263 | + /** | |
| 264 | + * Set the HTML content of the form field. | |
| 265 | + * | |
| 266 | + * @param string $htmlContent The HTML content to set. | |
| 267 | + */ | |
| 268 | + public function setHtmlContent(string $htmlContent): void | |
| 269 | + { | |
| 270 | + $this->fieldGeneralSettings->setHtmlContent($htmlContent); | |
| 271 | + } | |
| 272 | + | |
| 273 | + /** | |
| 274 | + * Get showRatingText flag. | |
| 275 | + * | |
| 276 | + * @return bool | |
| 277 | + */ | |
| 278 | + public function isShowRatingText(): bool | |
| 279 | + { | |
| 280 | + return $this->fieldGeneralSettings->isShowRatingText(); | |
| 281 | + } | |
| 282 | + | |
| 283 | + /** | |
| 284 | + * Set showRatingText flag. | |
| 285 | + * | |
| 286 | + * @param bool $val | |
| 287 | + */ | |
| 288 | + public function setShowRatingText(bool $val): void | |
| 289 | + { | |
| 290 | + $this->fieldGeneralSettings->setShowRatingText($val); | |
| 291 | + } | |
| 292 | + | |
| 293 | + /** | |
| 294 | + * Get the agreement text of the form field. | |
| 295 | + * | |
| 296 | + * @return string The agreement text. | |
| 297 | + */ | |
| 298 | + public function getAgreementText(): string | |
| 299 | + { | |
| 300 | + return $this->fieldGeneralSettings->getAgreementText(); | |
| 301 | + } | |
| 302 | + | |
| 303 | + /** | |
| 304 | + * Set the agreement text of the form field. | |
| 305 | + * | |
| 306 | + * @param string $agreementText The agreement text to set. | |
| 307 | + */ | |
| 308 | + public function setAgreementText(string $agreementText): void | |
| 309 | + { | |
| 310 | + $this->fieldGeneralSettings->setAgreementText($agreementText); | |
| 311 | + } | |
| 312 | + | |
| 313 | + /** | |
| 314 | + * @return bool | |
| 315 | + */ | |
| 316 | + public function isLimitRange(): bool | |
| 317 | + { | |
| 318 | + return $this->fieldGeneralSettings->isLimitRange(); | |
| 319 | + } | |
| 320 | + | |
| 321 | + /** | |
| 322 | + * @param bool $limitRange | |
| 323 | + */ | |
| 324 | + public function setLimitRange(bool $limitRange): void | |
| 325 | + { | |
| 326 | + $this->fieldGeneralSettings->setLimitRange($limitRange); | |
| 327 | + } | |
| 328 | + | |
| 329 | + /** | |
| 330 | + * @return array<string, bool|string> | |
| 331 | + */ | |
| 332 | + public function toArray(): array | |
| 333 | + { | |
| 334 | + return $this->fieldGeneralSettings->toArray(); | |
| 335 | + } | |
| 336 | +} | |