PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.1
Booking for Appointments and Events Calendar – Amelia v2.1
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 6 months ago
Cache.php
121 lines
1 <?php
2
3 /**
4 * @copyright © Melograno Ventures. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace AmeliaBooking\Domain\Entity\Cache;
9
10 use AmeliaBooking\Domain\ValueObjects\Json;
11 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
12 use AmeliaBooking\Domain\ValueObjects\String\Name;
13
14 /**
15 * Class Cache
16 *
17 * @package AmeliaBooking\Domain\Entity\Cache
18 */
19 class Cache
20 {
21 /** @var Id */
22 private $id;
23
24 /** @var Name */
25 private $name;
26
27 /** @var Id */
28 private $paymentId;
29
30 /** @var Json */
31 protected $data;
32
33 /**
34 * Cache constructor.
35 *
36 * @param Name $name
37 */
38 public function __construct(
39 Name $name
40 ) {
41 $this->name = $name;
42 }
43
44 /**
45 * @return Id
46 */
47 public function getId()
48 {
49 return $this->id;
50 }
51
52 /**
53 * @param Id $id
54 */
55 public function setId($id)
56 {
57 $this->id = $id;
58 }
59
60 /**
61 * @return Name
62 */
63 public function getName()
64 {
65 return $this->name;
66 }
67
68 /**
69 * @param Name $name
70 */
71 public function setName($name)
72 {
73 $this->name = $name;
74 }
75
76 /**
77 * @return Id
78 */
79 public function getPaymentId()
80 {
81 return $this->paymentId;
82 }
83
84 /**
85 * @param Id $paymentId
86 */
87 public function setPaymentId($paymentId)
88 {
89 $this->paymentId = $paymentId;
90 }
91
92 /**
93 * @return Json
94 */
95 public function getData()
96 {
97 return $this->data;
98 }
99
100 /**
101 * @param Json $data
102 */
103 public function setData(Json $data)
104 {
105 $this->data = $data;
106 }
107
108 /**
109 * @return array
110 */
111 public function toArray()
112 {
113 return [
114 'id' => $this->getId() ? $this->getId()->getValue() : null,
115 'name' => $this->getName()->getValue(),
116 'paymentId' => $this->getPaymentId() ? $this->getPaymentId()->getValue() : null,
117 'data' => $this->getData() ? $this->getData()->getValue() : null,
118 ];
119 }
120 }
121