|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the pexels-library package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2019 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Library\Pexels\Model; |
|
13
|
|
|
|
|
14
|
|
|
use WBW\Library\Traits\Strings\StringRawDataTrait; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Photo. |
|
18
|
|
|
* |
|
19
|
|
|
* @author webeweb <https://github.com/webeweb> |
|
20
|
|
|
* @package WBW\Library\Pexels\Model |
|
21
|
|
|
*/ |
|
22
|
|
|
class Photo extends AbstractMedia { |
|
23
|
|
|
|
|
24
|
|
|
use StringRawDataTrait; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Alt. |
|
28
|
|
|
* |
|
29
|
|
|
* @var string|null |
|
30
|
|
|
*/ |
|
31
|
|
|
private $alt; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Average color. |
|
35
|
|
|
* |
|
36
|
|
|
* @var string|null |
|
37
|
|
|
*/ |
|
38
|
|
|
private $avgColor; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Liked. |
|
42
|
|
|
* |
|
43
|
|
|
* @var bool|null |
|
44
|
|
|
*/ |
|
45
|
|
|
private $liked; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Photographer. |
|
49
|
|
|
* |
|
50
|
|
|
* @var string|null |
|
51
|
|
|
*/ |
|
52
|
|
|
private $photographer; |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
20 |
|
* Photographer id. |
|
56
|
20 |
|
* |
|
57
|
|
|
* @var string|null |
|
58
|
|
|
*/ |
|
59
|
|
|
private $photographerId; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Photographer URL. |
|
63
|
|
|
* |
|
64
|
15 |
|
* @var string|null |
|
65
|
15 |
|
*/ |
|
66
|
|
|
private $photographerUrl; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Source. |
|
70
|
|
|
* |
|
71
|
|
|
* @var Source|null |
|
72
|
|
|
*/ |
|
73
|
20 |
|
private $src; |
|
74
|
20 |
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Get the alt. |
|
77
|
|
|
* |
|
78
|
|
|
* @return string|null Returns the alt. |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getAlt(): ?string { |
|
81
|
|
|
return $this->alt; |
|
82
|
20 |
|
} |
|
83
|
20 |
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* Get the average color. |
|
86
|
|
|
* |
|
87
|
|
|
* @return string|null Returns the average color. |
|
88
|
|
|
*/ |
|
89
|
|
|
public function getAvgColor(): ?string { |
|
90
|
|
|
return $this->avgColor; |
|
91
|
|
|
} |
|
92
|
20 |
|
|
|
93
|
20 |
|
/** |
|
94
|
20 |
|
* Get the liked. |
|
95
|
|
|
* |
|
96
|
|
|
* @return bool|null Returns the liked. |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getLiked(): ?bool { |
|
99
|
|
|
return $this->liked; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
20 |
|
* Get the photographer. |
|
104
|
20 |
|
* |
|
105
|
20 |
|
* @return string|null Returns the photographer. |
|
106
|
|
|
*/ |
|
107
|
|
|
public function getPhotographer(): ?string { |
|
108
|
|
|
return $this->photographer; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* Get the photographer id. |
|
113
|
|
|
* |
|
114
|
20 |
|
* @return string|null Returns the photographer id. |
|
115
|
20 |
|
*/ |
|
116
|
20 |
|
public function getPhotographerId(): ?string { |
|
117
|
|
|
return $this->photographerId; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* Get the photographer URL. |
|
122
|
|
|
* |
|
123
|
|
|
* @return string|null Returns the photographer URL. |
|
124
|
|
|
*/ |
|
125
|
20 |
|
public function getPhotographerUrl(): ?string { |
|
126
|
20 |
|
return $this->photographerUrl; |
|
127
|
20 |
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* Get the source. |
|
131
|
|
|
* |
|
132
|
|
|
* @return Source|null Returns the source. |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getSrc(): ?Source { |
|
135
|
|
|
return $this->src; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* Set the alt. |
|
140
|
|
|
* |
|
141
|
|
|
* @param string|null $alt The alt. |
|
142
|
|
|
* @return Photo Returns this photo. |
|
143
|
|
|
*/ |
|
144
|
|
|
public function setAlt(?string $alt): Photo { |
|
145
|
|
|
$this->alt = $alt; |
|
146
|
|
|
return $this; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* Set the average color. |
|
151
|
|
|
* |
|
152
|
|
|
* @param string|null $avgColor The average color. |
|
153
|
|
|
* @return Photo Returns this photo. |
|
154
|
|
|
*/ |
|
155
|
|
|
public function setAvgColor(?string $avgColor): Photo { |
|
156
|
|
|
$this->avgColor = $avgColor; |
|
157
|
|
|
return $this; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* Set the liked. |
|
162
|
|
|
* |
|
163
|
|
|
* @param bool|null $liked The liked. |
|
164
|
|
|
* @return Photo Returns this photo. |
|
165
|
|
|
*/ |
|
166
|
|
|
public function setLiked(?bool $liked): Photo { |
|
167
|
|
|
$this->liked = $liked; |
|
168
|
|
|
return $this; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* Set the photographer. |
|
173
|
|
|
* |
|
174
|
|
|
* @param string|null $photographer The photographer. |
|
175
|
|
|
* @return Photo Returns this photo. |
|
176
|
|
|
*/ |
|
177
|
|
|
public function setPhotographer(?string $photographer): Photo { |
|
178
|
|
|
$this->photographer = $photographer; |
|
179
|
|
|
return $this; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* Set the photographer id. |
|
184
|
|
|
* |
|
185
|
|
|
* @param string|null $photographerId The photographer id. |
|
186
|
|
|
* @return Photo Returns this photo. |
|
187
|
|
|
*/ |
|
188
|
|
|
public function setPhotographerId(?string $photographerId): Photo { |
|
189
|
|
|
$this->photographerId = $photographerId; |
|
190
|
|
|
return $this; |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
/** |
|
194
|
|
|
* Set the photographer URL. |
|
195
|
|
|
* |
|
196
|
|
|
* @param string|null $photographerUrl The photographer URL. |
|
197
|
|
|
* @return Photo Returns this photo. |
|
198
|
|
|
*/ |
|
199
|
|
|
public function setPhotographerUrl(?string $photographerUrl): Photo { |
|
200
|
|
|
$this->photographerUrl = $photographerUrl; |
|
201
|
|
|
return $this; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* Set the source. |
|
206
|
|
|
* |
|
207
|
|
|
* @param Source|null $src The source. |
|
208
|
|
|
* @return Photo Returns this photo. |
|
209
|
|
|
*/ |
|
210
|
|
|
public function setSrc(?Source $src): Photo { |
|
211
|
|
|
$this->src = $src; |
|
212
|
|
|
return $this; |
|
213
|
|
|
} |
|
214
|
|
|
} |
|
215
|
|
|
|