PluginProbe
The Innovative Form Builder – IvyForms / 0.8
The Innovative Form Builder – IvyForms v0.8
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 1.2 1.3
ivyforms / backend / src / Entity / Field / FieldAdvancedSettings.php

FieldAdvancedSettings.php in The Innovative Form Builder – IvyForms 0.8, at backend/src/Entity/Field/FieldAdvancedSettings.php

177 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Entity\Field;
4
5 use IvyForms\ValueObjects\Field\FieldAdvancedSettings as FieldAdvancedSettingsVO;
6
7 // phpcs:disable PSR1.Files.SideEffects
8 if (!defined('ABSPATH')) {
9 exit; // Exit if accessed directly
10 }
11
12 /**
13 * Class fieldAdvancedSettings
14 *
15 * Entity wrapper for fieldAdvancedSettings ValueObject.
16 */
17 class FieldAdvancedSettings
18 {
19 private FieldAdvancedSettingsVO $fieldAdvancedSettings;
20
21 /**
22 * @param FieldAdvancedSettingsVO $fieldAdvancedSettings
23 */
24 public function __construct(FieldAdvancedSettingsVO $fieldAdvancedSettings)
25 {
26 $this->fieldAdvancedSettings = $fieldAdvancedSettings;
27 }
28
29 /**
30 * Check if maximum length limit is enabled.
31 *
32 * @return bool
33 */
34 public function isLimitMaxLength(): bool
35 {
36 return $this->fieldAdvancedSettings->isLimitMaxLength();
37 }
38
39 /**
40 * Set the limit maximum length setting.
41 *
42 * @param bool $limitMaxLength
43 */
44 public function setLimitMaxLength(bool $limitMaxLength): void
45 {
46 $this->fieldAdvancedSettings->setLimitMaxLength($limitMaxLength);
47 }
48
49 /**
50 * Get the maximum length.
51 *
52 * @return int
53 */
54 public function getMaxLength(): int
55 {
56 return $this->fieldAdvancedSettings->getMaxLength();
57 }
58
59 /**
60 * Set the maximum length setting.
61 *
62 * @param int $maxLength
63 */
64 public function setMaxLength(int $maxLength): void
65 {
66 $this->fieldAdvancedSettings->setMaxLength($maxLength);
67 }
68
69 /**
70 * Get the label position.
71 *
72 * @return string
73 */
74 public function getLabelPosition(): string
75 {
76 return $this->fieldAdvancedSettings->getLabelPosition();
77 }
78
79 /**
80 * Set the label position setting.
81 *
82 * @param string $labelPosition
83 */
84 public function setLabelPosition(string $labelPosition): void
85 {
86 $this->fieldAdvancedSettings->setLabelPosition($labelPosition);
87 }
88
89 /**
90 * Check if no duplicates is enabled.
91 *
92 * @return bool
93 */
94 public function isNoDuplicates(): bool
95 {
96 return $this->fieldAdvancedSettings->isNoDuplicates();
97 }
98
99 /**
100 * Set the no duplicates setting.
101 *
102 * @param bool $noDuplicates
103 */
104 public function setNoDuplicates(bool $noDuplicates): void
105 {
106 $this->fieldAdvancedSettings->setNoDuplicates($noDuplicates);
107 }
108
109 /**
110 * Get the default value of the form field.
111 *
112 * @return string The default value of the form field.
113 */
114 public function getDefaultValue(): string
115 {
116 return $this->fieldAdvancedSettings->getDefaultValue();
117 }
118
119 /**
120 * Set the default value of the form field.
121 *
122 * @param string $defaultValue The default value to set.
123 */
124 public function setDefaultValue(string $defaultValue): void
125 {
126 $this->fieldAdvancedSettings->setDefaultValue($defaultValue);
127 }
128
129 /**
130 * Get the field prefix.
131 *
132 * @return string
133 */
134 public function getInputPrefix(): string
135 {
136 return $this->fieldAdvancedSettings->getInputPrefix();
137 }
138
139 /**
140 * Set the field prefix.
141 *
142 * @param string $prefix
143 */
144 public function setInputPrefix(string $prefix): void
145 {
146 $this->fieldAdvancedSettings->setInputPrefix($prefix);
147 }
148
149 /**
150 * Get the field suffix.
151 *
152 * @return string
153 */
154 public function getInputSuffix(): string
155 {
156 return $this->fieldAdvancedSettings->getInputSuffix();
157 }
158
159 /**
160 * Set the field suffix.
161 *
162 * @param string $suffix
163 */
164 public function setInputSuffix(string $suffix): void
165 {
166 $this->fieldAdvancedSettings->setInputSuffix($suffix);
167 }
168
169 /**
170 * @return array<string, bool|string>
171 */
172 public function toArray(): array
173 {
174 return $this->fieldAdvancedSettings->toArray();
175 }
176 }
177