PluginProbe
The Innovative Form Builder – IvyForms / 0.9.1
The Innovative Form Builder – IvyForms v0.9.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
ivyforms / backend / src / ValueObjects / Field / TimeFieldGeneralSettings.php

TimeFieldGeneralSettings.php in The Innovative Form Builder – IvyForms 0.9.1, at backend/src/ValueObjects/Field/TimeFieldGeneralSettings.php

137 lines 2.9 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 TimeFieldGeneralSettings
17 *
18 * Encapsulates time-specific settings extracted from FieldGeneralSettings.
19 */
20 final class TimeFieldGeneralSettings
21 {
22 /**
23 * @var string
24 */
25 private string $timeFieldType;
26
27 /**
28 * @var string
29 */
30 private string $timeFormat;
31
32 /**
33 * @var string|null
34 */
35 private ?string $minTimeValue = null;
36
37 /**
38 * @var string|null
39 */
40 private ?string $maxTimeValue = null;
41
42 /**
43 * @var bool
44 */
45 private bool $limitTimeRange = false;
46
47 public function __construct(
48 bool $limitTimeRange,
49 string $timeFieldType = '',
50 string $timeFormat = '',
51 ?string $minTimeValue = null,
52 ?string $maxTimeValue = null
53 ) {
54 $this->timeFieldType = $timeFieldType;
55 $this->timeFormat = $timeFormat;
56 $this->minTimeValue = $minTimeValue;
57 $this->maxTimeValue = $maxTimeValue;
58 $this->limitTimeRange = $limitTimeRange;
59 }
60
61 /**
62 * Get timeFieldType.
63 */
64 public function getTimeFieldType(): string
65 {
66 return $this->timeFieldType;
67 }
68
69 /**
70 * Set timeFieldType.
71 */
72 public function setTimeFieldType(string $timeFieldType): void
73 {
74 $this->timeFieldType = $timeFieldType;
75 }
76
77 /**
78 * Get timeFormat.
79 */
80 public function getTimeFormat(): string
81 {
82 return $this->timeFormat;
83 }
84
85 /**
86 * Set timeFormat.
87 */
88 public function setTimeFormat(string $timeFormat): void
89 {
90 $this->timeFormat = $timeFormat;
91 }
92
93 public function getMinTimeValue(): ?string
94 {
95 return $this->minTimeValue;
96 }
97
98 public function setMinTimeValue(?string $minTimeValue): void
99 {
100 $this->minTimeValue = $minTimeValue;
101 }
102
103 public function getMaxTimeValue(): ?string
104 {
105 return $this->maxTimeValue;
106 }
107
108 public function setMaxTimeValue(?string $maxTimeValue): void
109 {
110 $this->maxTimeValue = $maxTimeValue;
111 }
112
113 public function getLimitTimeRange(): bool
114 {
115 return $this->limitTimeRange;
116 }
117
118 public function setLimitTimeRange(bool $limitTimeRange): void
119 {
120 $this->limitTimeRange = $limitTimeRange;
121 }
122
123 /**
124 * @return array<string, string|bool|null>
125 */
126 public function toArray(): array
127 {
128 return [
129 'timeFieldType' => $this->getTimeFieldType(),
130 'timeFormat' => $this->getTimeFormat(),
131 'minTimeValue' => $this->getMinTimeValue(),
132 'maxTimeValue' => $this->getMaxTimeValue(),
133 'limitTimeRange' => $this->getLimitTimeRange(),
134 ];
135 }
136 }
137