PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
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
← All changes | backend/src/ValueObjects/Field/TimeFieldGeneralSettings.php +61 -10 0.7 → 1.5.1 View file →
@@ -6,13 +6,8 @@
6 6 */
7 7
8 8 namespace IvyForms\ValueObjects\Field;
9 9
10 -// phpcs:disable PSR1.Files.SideEffects
11 -if (!defined('ABSPATH')) {
12 - exit; // Exit if accessed directly
13 -}
14 -
15 10 /**
16 11 * Class TimeFieldGeneralSettings
17 12 *
18 13 * Encapsulates time-specific settings extracted from FieldGeneralSettings.
@@ -28,12 +23,35 @@
28 23 * @var string
29 24 */
30 25 private string $timeFormat;
31 26
32 - public function __construct(string $timeFieldType = '', string $timeFormat = '')
33 - {
27 + /**
28 + * @var string|null
29 + */
30 + private ?string $minTimeValue = null;
31 +
32 + /**
33 + * @var string|null
34 + */
35 + private ?string $maxTimeValue = null;
36 +
37 + /**
38 + * @var bool
39 + */
40 + private bool $limitTimeRange = false;
41 +
42 + public function __construct(
43 + bool $limitTimeRange,
44 + string $timeFieldType = '',
45 + string $timeFormat = '',
46 + ?string $minTimeValue = null,
47 + ?string $maxTimeValue = null
48 + ) {
34 49 $this->timeFieldType = $timeFieldType;
35 50 $this->timeFormat = $timeFormat;
51 + $this->minTimeValue = $minTimeValue;
52 + $this->maxTimeValue = $maxTimeValue;
53 + $this->limitTimeRange = $limitTimeRange;
36 54 }
37 55
38 56 /**
39 57 * Get timeFieldType.
@@ -66,15 +84,48 @@
66 84 {
67 85 $this->timeFormat = $timeFormat;
68 86 }
69 87
88 + public function getMinTimeValue(): ?string
89 + {
90 + return $this->minTimeValue;
91 + }
92 +
93 + public function setMinTimeValue(?string $minTimeValue): void
94 + {
95 + $this->minTimeValue = $minTimeValue;
96 + }
97 +
98 + public function getMaxTimeValue(): ?string
99 + {
100 + return $this->maxTimeValue;
101 + }
102 +
103 + public function setMaxTimeValue(?string $maxTimeValue): void
104 + {
105 + $this->maxTimeValue = $maxTimeValue;
106 + }
107 +
108 + public function getLimitTimeRange(): bool
109 + {
110 + return $this->limitTimeRange;
111 + }
112 +
113 + public function setLimitTimeRange(bool $limitTimeRange): void
114 + {
115 + $this->limitTimeRange = $limitTimeRange;
116 + }
117 +
70 118 /**
71 - * @return array<string, string>
119 + * @return array<string, string|bool|null>
72 120 */
73 121 public function toArray(): array
74 122 {
75 123 return [
76 - 'timeFieldType' => $this->getTimeFieldType(),
77 - 'timeFormat' => $this->getTimeFormat(),
124 + 'timeFieldType' => $this->getTimeFieldType(),
125 + 'timeFormat' => $this->getTimeFormat(),
126 + 'minTimeValue' => $this->getMinTimeValue(),
127 + 'maxTimeValue' => $this->getMaxTimeValue(),
128 + 'limitTimeRange' => $this->getLimitTimeRange(),
78 129 ];
79 130 }
80 131 }