PluginProbe
The Innovative Form Builder – IvyForms / 0.2.1
The Innovative Form Builder – IvyForms v0.2.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 / Entity / Confirmation / Confirmation.php

Confirmation.php in The Innovative Form Builder – IvyForms 0.2.1, at backend/src/Entity/Confirmation/Confirmation.php

213 lines 4.1 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\Confirmation;
4
5 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 use IvyForms\ValueObjects\Confirmation\Confirmation as ConfirmationValueObject;
11
12 /**
13 * Class Confirmation
14 *
15 * @package IvyForms\Entity\Confirmation
16 */
17 class Confirmation
18 {
19 /**
20 * @var ConfirmationValueObject
21 */
22 private ConfirmationValueObject $confirmation;
23
24 /**
25 * Confirmation constructor.
26 *
27 * @param ConfirmationValueObject $confirmation The confirmation object.
28 */
29 public function __construct(ConfirmationValueObject $confirmation)
30 {
31 $this->confirmation = $confirmation;
32 }
33
34 /**
35 * Get the confirmation ID.
36 *
37 * @return int
38 */
39 public function getId(): int
40 {
41 return $this->confirmation->getId();
42 }
43
44 /**
45 * Set the confirmation ID.
46 *
47 * @param int $id
48 */
49 public function setId(int $id): void
50 {
51 $this->confirmation->id = $id;
52 }
53
54 /**
55 * Get the form ID.
56 *
57 * @return int
58 */
59 public function getFormId(): int
60 {
61 return $this->confirmation->getFormId();
62 }
63
64 /**
65 * Set the form ID.
66 *
67 * @param int $formId
68 */
69 public function setFormId(int $formId): void
70 {
71 $this->confirmation->formId = $formId;
72 }
73
74 /**
75 * Get the confirmation type.
76 *
77 * @return string
78 */
79 public function getType(): string
80 {
81 return $this->confirmation->getType();
82 }
83
84 /**
85 * Set the confirmation type.
86 *
87 * @param string $type
88 */
89 public function setType(string $type): void
90 {
91 $this->confirmation->type = $type;
92 }
93
94 /**
95 * Get the confirmation status.
96 *
97 * @return bool
98 */
99 public function isEnabled(): bool
100 {
101 return $this->confirmation->isEnabled();
102 }
103
104 /**
105 * Set the confirmation status.
106 *
107 * @param bool $enabled
108 */
109 public function setEnabled(bool $enabled): void
110 {
111 $this->confirmation->enabled = $enabled;
112 }
113
114 /**
115 * Get the show form flag.
116 *
117 * @return bool
118 */
119 public function isShowForm(): bool
120 {
121 return $this->confirmation->isShowForm();
122 }
123
124 /**
125 * Set the show form flag.
126 *
127 * @param bool $showForm
128 */
129 public function setShowForm(bool $showForm): void
130 {
131 $this->confirmation->showForm = $showForm;
132 }
133
134 /**
135 * Get the confirmation message.
136 *
137 * @return string
138 */
139 public function getMessage(): string
140 {
141 return $this->confirmation->getMessage();
142 }
143
144 /**
145 * Set the confirmation message.
146 *
147 * @param string $message
148 */
149 public function setMessage(string $message): void
150 {
151 $this->confirmation->message = $message;
152 }
153
154 /**
155 * Get the confirmation URL.
156 *
157 * @return string
158 */
159 public function getUrl(): string
160 {
161 return $this->confirmation->getUrl();
162 }
163
164 /**
165 * Set the confirmation URL.
166 *
167 * @param string $url
168 */
169 public function setUrl(string $url): void
170 {
171 $this->confirmation->url = $url;
172 }
173
174 /**
175 * Get the confirmation page.
176 *
177 * @return string
178 */
179 public function getPage(): string
180 {
181 return $this->confirmation->getPage();
182 }
183
184 /**
185 * Set the confirmation page.
186 *
187 * @param string $page
188 */
189 public function setPage(string $page): void
190 {
191 $this->confirmation->page = $page;
192 }
193
194 /**
195 * Convert the confirmation entity to an array.
196 *
197 * @return array<string, mixed> The confirmation entity as an array.
198 */
199 public function toArray(): array
200 {
201 return [
202 'id' => $this->getId(),
203 'formId' => $this->getFormId(),
204 'type' => $this->getType(),
205 'enabled' => $this->isEnabled(),
206 'showForm' => $this->isShowForm(),
207 'message' => $this->getMessage(),
208 'url' => $this->getUrl(),
209 'page' => $this->getPage(),
210 ];
211 }
212 }
213