PluginProbe
The Innovative Form Builder – IvyForms / 0.6.1-backup
The Innovative Form Builder – IvyForms v0.6.1-backup
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / ValueObjects / Field / DateFieldGeneralSettings.php

DateFieldGeneralSettings.php in The Innovative Form Builder – IvyForms 0.6.1-backup, at backend/src/ValueObjects/Field/DateFieldGeneralSettings.php

131 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © Melograno Venture Studio. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace IvyForms\ValueObjects\Field;
9
10 // phpcs:disable PSR1.Files.SideEffects
11 if (!defined('ABSPATH')) {
12 exit; // Exit if accessed directly
13 }
14
15 /**
16 * Class DateFieldGeneralSettings
17 *
18 * Encapsulates date-specific settings extracted from FieldGeneralSettings.
19 */
20 final class DateFieldGeneralSettings
21 {
22 /**
23 * @var string
24 */
25 private string $dateFieldType;
26
27 /**
28 * @var string
29 */
30 private string $dateFormat;
31
32 /**
33 * @var string|null
34 */
35 private ?string $minDateValue;
36
37 /**
38 * @var string|null
39 */
40 private ?string $maxDateValue;
41
42 public function __construct(
43 string $dateFieldType = '',
44 string $dateFormat = '',
45 ?string $minDateValue = null,
46 ?string $maxDateValue = null
47 ) {
48 $this->dateFieldType = $dateFieldType;
49 $this->dateFormat = $dateFormat;
50 $this->minDateValue = $minDateValue;
51 $this->maxDateValue = $maxDateValue;
52 }
53
54 /**
55 * Get dateFieldType.
56 */
57 public function getDateFieldType(): string
58 {
59 return $this->dateFieldType;
60 }
61
62 /**
63 * Set dateFieldType.
64 */
65 public function setDateFieldType(string $dateFieldType): void
66 {
67 $this->dateFieldType = $dateFieldType;
68 }
69
70 /**
71 * Get dateFormat.
72 */
73 public function getDateFormat(): string
74 {
75 return $this->dateFormat;
76 }
77
78 /**
79 * Set dateFormat.
80 */
81 public function setDateFormat(string $dateFormat): void
82 {
83 $this->dateFormat = $dateFormat;
84 }
85
86 /**
87 * Get minDateValue.
88 */
89 public function getMinDateValue(): ?string
90 {
91 return $this->minDateValue;
92 }
93
94 /**
95 * Set minDateValue.
96 */
97 public function setMinDateValue(?string $minDateValue): void
98 {
99 $this->minDateValue = $minDateValue;
100 }
101
102 /**
103 * Get maxDateValue.
104 */
105 public function getMaxDateValue(): ?string
106 {
107 return $this->maxDateValue;
108 }
109
110 /**
111 * Set maxDateValue.
112 */
113 public function setMaxDateValue(?string $maxDateValue): void
114 {
115 $this->maxDateValue = $maxDateValue;
116 }
117
118 /**
119 * @return array<string, string|null>
120 */
121 public function toArray(): array
122 {
123 return [
124 'dateFieldType' => $this->getDateFieldType(),
125 'dateFormat' => $this->getDateFormat(),
126 'minDateValue' => $this->getMinDateValue(),
127 'maxDateValue' => $this->getMaxDateValue(),
128 ];
129 }
130 }
131