PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
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 / Gallery / GalleryImage.php
ameliabooking / src / Domain / Entity / Gallery Last commit date
GalleryImage.php 1 year ago
GalleryImage.php
144 lines
1 <?php
2
3 namespace AmeliaBooking\Domain\Entity\Gallery;
4
5 use AmeliaBooking\Domain\ValueObjects\Number\Integer\PositiveInteger;
6 use AmeliaBooking\Domain\ValueObjects\Picture;
7 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
8 use AmeliaBooking\Domain\ValueObjects\String\EntityType;
9
10 /**
11 * Class GalleryImage
12 *
13 * @package AmeliaBooking\Domain\Entity\Gallery
14 */
15 class GalleryImage
16 {
17 /** @var Id */
18 private $id;
19
20 /** @var Id */
21 private $entityId;
22
23 /** @var EntityType */
24 private $entityType;
25
26 /** @var Picture */
27 private $picture;
28
29 /** @var PositiveInteger */
30 protected $position;
31
32 /**
33 * GalleryImage constructor.
34 *
35 * @param EntityType $entityType
36 * @param Picture $picture
37 * @param PositiveInteger $position
38 */
39 public function __construct(
40 EntityType $entityType,
41 Picture $picture,
42 PositiveInteger $position
43 ) {
44 $this->entityType = $entityType;
45 $this->picture = $picture;
46 $this->position = $position;
47 }
48
49 /**
50 * @return Id
51 */
52 public function getId()
53 {
54 return $this->id;
55 }
56
57 /**
58 * @param Id $id
59 */
60 public function setId(Id $id)
61 {
62 $this->id = $id;
63 }
64
65 /**
66 * @return Id
67 */
68 public function getEntityId()
69 {
70 return $this->entityId;
71 }
72
73 /**
74 * @param Id $entityId
75 */
76 public function setEntityId(Id $entityId)
77 {
78 $this->entityId = $entityId;
79 }
80
81 /**
82 * @return EntityType
83 */
84 public function getEntityType()
85 {
86 return $this->entityType;
87 }
88
89 /**
90 * @param EntityType $entityType
91 */
92 public function setEntityType(EntityType $entityType)
93 {
94 $this->entityType = $entityType;
95 }
96
97 /**
98 * @return Picture
99 */
100 public function getPicture()
101 {
102 return $this->picture;
103 }
104
105 /**
106 * @param Picture $picture
107 */
108 public function setPicture(Picture $picture)
109 {
110 $this->picture = $picture;
111 }
112
113 /**
114 * @return PositiveInteger
115 */
116 public function getPosition()
117 {
118 return $this->position;
119 }
120
121 /**
122 * @param PositiveInteger $position
123 */
124 public function setPosition(PositiveInteger $position)
125 {
126 $this->position = $position;
127 }
128
129 /**
130 * @return array
131 */
132 public function toArray()
133 {
134 return [
135 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
136 'entityId' => null !== $this->getEntityId() ? $this->getEntityId()->getValue() : null,
137 'entityType' => null !== $this->getEntityType() ? $this->getEntityType()->getValue() : null,
138 'pictureFullPath' => null !== $this->getPicture() ? $this->getPicture()->getFullPath() : null,
139 'pictureThumbPath' => null !== $this->getPicture() ? $this->getPicture()->getThumbPath() : null,
140 'position' => null !== $this->getPosition() ? $this->getPosition()->getValue() : null,
141 ];
142 }
143 }
144