PluginProbe
The Innovative Form Builder – IvyForms / 0.8.2
The Innovative Form Builder – IvyForms v0.8.2
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.8.2, at backend/src/ValueObjects/Field/TimeFieldGeneralSettings.php

81 lines 1.6 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 public function __construct(string $timeFieldType = '', string $timeFormat = '')
33 {
34 $this->timeFieldType = $timeFieldType;
35 $this->timeFormat = $timeFormat;
36 }
37
38 /**
39 * Get timeFieldType.
40 */
41 public function getTimeFieldType(): string
42 {
43 return $this->timeFieldType;
44 }
45
46 /**
47 * Set timeFieldType.
48 */
49 public function setTimeFieldType(string $timeFieldType): void
50 {
51 $this->timeFieldType = $timeFieldType;
52 }
53
54 /**
55 * Get timeFormat.
56 */
57 public function getTimeFormat(): string
58 {
59 return $this->timeFormat;
60 }
61
62 /**
63 * Set timeFormat.
64 */
65 public function setTimeFormat(string $timeFormat): void
66 {
67 $this->timeFormat = $timeFormat;
68 }
69
70 /**
71 * @return array<string, string>
72 */
73 public function toArray(): array
74 {
75 return [
76 'timeFieldType' => $this->getTimeFieldType(),
77 'timeFormat' => $this->getTimeFormat(),
78 ];
79 }
80 }
81