| @@ -3,13 +3,8 @@ | ||
| 3 | 3 | namespace IvyForms\Entity\Field; |
| 4 | 4 | |
| 5 | 5 | use IvyForms\ValueObjects\Field\FieldGeneralSettings as FieldGeneralSettingsVO; |
| 6 | 6 | |
| 7 | -// phpcs:disable PSR1.Files.SideEffects | |
| 8 | -if (!defined('ABSPATH')) { | |
| 9 | - exit; // Exit if accessed directly | |
| 10 | -} | |
| 11 | - | |
| 12 | 7 | /** |
| 13 | 8 | * Class FieldGeneralSettings |
| 14 | 9 | * |
| 15 | 10 | * Entity wrapper for FieldGeneralSettings ValueObject. |
| @@ -190,9 +185,9 @@ | ||
| 190 | 185 | return $this->fieldGeneralSettings->getStep(); |
| 191 | 186 | } |
| 192 | 187 | |
| 193 | 188 | /** |
| 194 | - * Set step increment. | |
| 189 | + * Set step value. | |
| 195 | 190 | * @param float $step |
| 196 | 191 | */ |
| 197 | 192 | public function setStep(float $step): void |
| 198 | 193 | { |
| @@ -199,8 +194,26 @@ | ||
| 199 | 194 | $this->fieldGeneralSettings->setStep($step); |
| 200 | 195 | } |
| 201 | 196 | |
| 202 | 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 | + /** | |
| 203 | 216 | * Get number format key. |
| 204 | 217 | * @return string |
| 205 | 218 | */ |
| 206 | 219 | public function getNumberFormat(): string |
| @@ -235,8 +248,85 @@ | ||
| 235 | 248 | public function setPhoneAutoDetect(bool $val): void |
| 236 | 249 | { |
| 237 | 250 | $this->fieldGeneralSettings->setPhoneAutoDetect($val); |
| 238 | 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 | + | |
| 239 | 329 | /** |
| 240 | 330 | * @return array<string, bool|string> |
| 241 | 331 | */ |
| 242 | 332 | public function toArray(): array |