PluginProbe
The Innovative Form Builder – IvyForms / 1.1.1
The Innovative Form Builder – IvyForms v1.1.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 / ConfirmationGeneralSettings.php

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

133 lines 3.0 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 /**
11 * Class ConfirmationGeneralSettings
12 *
13 * Encapsulates confirmation field settings (email/password confirmation).
14 */
15 final class ConfirmationGeneralSettings
16 {
17 /**
18 * @var bool
19 */
20 private bool $confirmFieldEnabled;
21
22 /**
23 * @var string
24 */
25 private string $confirmFieldLabel;
26
27 /**
28 * @var string
29 */
30 private string $confirmFieldPlaceholder;
31
32 /**
33 * @var bool
34 */
35 private bool $confirmFieldHideLabel;
36
37 /**
38 * @param bool $confirmFieldEnabled
39 * @param string $confirmFieldLabel
40 * @param string $confirmFieldPlaceholder
41 * @param bool $confirmFieldHideLabel
42 *
43 */
44 public function __construct(
45 bool $confirmFieldEnabled,
46 string $confirmFieldLabel,
47 string $confirmFieldPlaceholder,
48 bool $confirmFieldHideLabel
49 ) {
50 $this->confirmFieldEnabled = $confirmFieldEnabled;
51 $this->confirmFieldLabel = $confirmFieldLabel;
52 $this->confirmFieldPlaceholder = $confirmFieldPlaceholder;
53 $this->confirmFieldHideLabel = $confirmFieldHideLabel;
54 }
55
56 /**
57 * Get confirmFieldEnabled.
58 */
59 public function isConfirmFieldEnabled(): bool
60 {
61 return $this->confirmFieldEnabled;
62 }
63
64 /**
65 * Set confirmFieldEnabled.
66 */
67 public function setConfirmFieldEnabled(bool $enabled): void
68 {
69 $this->confirmFieldEnabled = $enabled;
70 }
71
72 /**
73 * Get confirmFieldLabel.
74 */
75 public function getConfirmFieldLabel(): string
76 {
77 return $this->confirmFieldLabel;
78 }
79
80 /**
81 * Set confirmFieldLabel.
82 */
83 public function setConfirmFieldLabel(string $label): void
84 {
85 $this->confirmFieldLabel = $label;
86 }
87
88 /**
89 * Get confirmFieldPlaceholder.
90 */
91 public function getConfirmFieldPlaceholder(): string
92 {
93 return $this->confirmFieldPlaceholder;
94 }
95
96 /**
97 * Set confirmFieldPlaceholder.
98 */
99 public function setConfirmFieldPlaceholder(string $placeholder): void
100 {
101 $this->confirmFieldPlaceholder = $placeholder;
102 }
103
104 /**
105 * Get confirmFieldHideLabel.
106 */
107 public function isConfirmFieldHideLabel(): bool
108 {
109 return $this->confirmFieldHideLabel;
110 }
111
112 /**
113 * Set confirmFieldHideLabel.
114 */
115 public function setConfirmFieldHideLabel(bool $hideLabel): void
116 {
117 $this->confirmFieldHideLabel = $hideLabel;
118 }
119
120 /**
121 * @return array<string, mixed>
122 */
123 public function toArray(): array
124 {
125 return [
126 'confirmFieldEnabled' => $this->isConfirmFieldEnabled(),
127 'confirmFieldLabel' => $this->getConfirmFieldLabel(),
128 'confirmFieldPlaceholder' => $this->getConfirmFieldPlaceholder(),
129 'confirmFieldHideLabel' => $this->isConfirmFieldHideLabel(),
130 ];
131 }
132 }
133