PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Domain / Entity / Cache / Cache.php
ameliabooking / src / Domain / Entity / Cache Last commit date
Cache.php 5 years ago
Cache.php
120 lines
1 <?php
2 /**
3 * @copyright © TMS-Plugins. All rights reserved.
4 * @licence See LICENCE.md for license details.
5 */
6
7 namespace AmeliaBooking\Domain\Entity\Cache;
8
9 use AmeliaBooking\Domain\ValueObjects\Json;
10 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
11 use AmeliaBooking\Domain\ValueObjects\String\Name;
12
13 /**
14 * Class Cache
15 *
16 * @package AmeliaBooking\Domain\Entity\Cache
17 */
18 class Cache
19 {
20 /** @var Id */
21 private $id;
22
23 /** @var Name */
24 private $name;
25
26 /** @var Id */
27 private $paymentId;
28
29 /** @var Json */
30 protected $data;
31
32 /**
33 * Cache constructor.
34 *
35 * @param Name $name
36 */
37 public function __construct(
38 Name $name
39 ) {
40 $this->name = $name;
41 }
42
43 /**
44 * @return Id
45 */
46 public function getId()
47 {
48 return $this->id;
49 }
50
51 /**
52 * @param Id $id
53 */
54 public function setId($id)
55 {
56 $this->id = $id;
57 }
58
59 /**
60 * @return Name
61 */
62 public function getName()
63 {
64 return $this->name;
65 }
66
67 /**
68 * @param Name $name
69 */
70 public function setName($name)
71 {
72 $this->name = $name;
73 }
74
75 /**
76 * @return Id
77 */
78 public function getPaymentId()
79 {
80 return $this->paymentId;
81 }
82
83 /**
84 * @param Id $paymentId
85 */
86 public function setPaymentId($paymentId)
87 {
88 $this->paymentId = $paymentId;
89 }
90
91 /**
92 * @return Json
93 */
94 public function getData()
95 {
96 return $this->data;
97 }
98
99 /**
100 * @param Json $data
101 */
102 public function setData(Json $data)
103 {
104 $this->data = $data;
105 }
106
107 /**
108 * @return array
109 */
110 public function toArray()
111 {
112 return [
113 'id' => $this->getId() ? $this->getId()->getValue() : null,
114 'name' => $this->getName()->getValue(),
115 'paymentId' => $this->getPaymentId() ? $this->getPaymentId()->getValue() : null,
116 'data' => $this->getData() ? $this->getData()->getValue() : null,
117 ];
118 }
119 }
120