PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.15
VikBooking Hotel Booking Engine & PMS v1.8.15
1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 All 36 releases
vikbooking / admin / helpers / src / dooraccess / device / capability / result.php

result.php in VikBooking Hotel Booking Engine & PMS 1.8.15, at admin/helpers/src/dooraccess/device/capability/result.php

158 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 * @package VikBooking
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2025 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * Door Access device capability result implementation.
16 *
17 * @since 1.18.4 (J) - 1.8.4 (WP)
18 */
19 final class VBODooraccessDeviceCapabilityResult
20 {
21 /**
22 * @var ?string
23 */
24 protected ?string $passcode = null;
25
26 /**
27 * @var ?string
28 */
29 protected ?string $html = null;
30
31 /**
32 * @var ?string
33 */
34 protected ?string $text = null;
35
36 /**
37 * @var ?array
38 */
39 protected ?array $properties = null;
40
41 /**
42 * Class constructor.
43 *
44 * @param ?array $data Optional result data properties to bind.
45 */
46 public function __construct(?array $data = null)
47 {
48 if ($data) {
49 // bind result data properties
50 $this->properties = $data;
51 }
52 }
53
54 /**
55 * Returns the result passcode string.
56 *
57 * @return ?string
58 */
59 public function getPasscode()
60 {
61 return $this->passcode;
62 }
63
64 /**
65 * Sets the passcode result string.
66 *
67 * @param string $passcode The passcode to set.
68 *
69 * @return self
70 */
71 public function setPasscode(string $passcode)
72 {
73 $this->passcode = $passcode;
74
75 return $this;
76 }
77
78 /**
79 * Returns the HTML result output string.
80 *
81 * @return ?string
82 */
83 public function getOutput()
84 {
85 return $this->html;
86 }
87
88 /**
89 * Sets the HTML output string.
90 *
91 * @param string $output The result value to set.
92 *
93 * @return self
94 */
95 public function setOutput(string $output)
96 {
97 $this->html = $output;
98
99 return $this;
100 }
101
102 /**
103 * Returns the text result string.
104 *
105 * @return ?string
106 */
107 public function getText()
108 {
109 return $this->text;
110 }
111
112 /**
113 * Sets the text result string.
114 *
115 * @param string $output The result value to set.
116 *
117 * @return self
118 */
119 public function setText(string $output)
120 {
121 $this->text = $output;
122
123 return $this;
124 }
125
126 /**
127 * Returns the result data properties array (nullable).
128 *
129 * @return ?array
130 */
131 public function getProperties()
132 {
133 return $this->properties;
134 }
135
136 /**
137 * Binds the result data properties array.
138 *
139 * @param array $data Data properties to bind.
140 *
141 * @return self
142 */
143 public function setProperties(array $data)
144 {
145 $this->properties = $data;
146
147 return $this;
148 }
149
150 /**
151 * Returns the proper result output value.
152 */
153 public function __toString()
154 {
155 return $this->getOutput() ?: $this->getText();
156 }
157 }
158