1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Iptc: A container class for IPTC data |
4
|
|
|
* |
5
|
|
|
* @link http://github.com/PHPExif/php-exif-common for the canonical source repository |
6
|
|
|
* @copyright Copyright (c) 2016 Tom Van Herreweghe <[email protected]> |
7
|
|
|
* @license http://github.com/PHPExif/php-exif-common/blob/master/LICENSE MIT License |
8
|
|
|
* @category PHPExif |
9
|
|
|
* @package Common |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace PHPExif\Common\Data; |
13
|
|
|
|
14
|
|
|
use PHPExif\Common\Collection\Collection; |
15
|
|
|
use PHPExif\Common\Data\ValueObject\Caption; |
16
|
|
|
use PHPExif\Common\Data\ValueObject\Copyright; |
17
|
|
|
use PHPExif\Common\Data\ValueObject\Credit; |
18
|
|
|
use PHPExif\Common\Data\ValueObject\Headline; |
19
|
|
|
use PHPExif\Common\Data\ValueObject\Jobtitle; |
20
|
|
|
use PHPExif\Common\Data\ValueObject\Source; |
21
|
|
|
use PHPExif\Common\Data\ValueObject\Title; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Iptc class |
25
|
|
|
* |
26
|
|
|
* Container for IPTC data |
27
|
|
|
* |
28
|
|
|
* @category PHPExif |
29
|
|
|
* @package Common |
30
|
|
|
*/ |
31
|
|
|
class Iptc implements IptcInterface |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* @var Caption |
35
|
|
|
*/ |
36
|
|
|
protected $caption; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var Copyright |
40
|
|
|
*/ |
41
|
|
|
protected $copyright; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var Credit |
45
|
|
|
*/ |
46
|
|
|
protected $credit; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var Headline |
50
|
|
|
*/ |
51
|
|
|
protected $headline; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var Jobtitle |
55
|
|
|
*/ |
56
|
|
|
protected $jobtitle; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var Source |
60
|
|
|
*/ |
61
|
|
|
protected $source; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var Title |
65
|
|
|
*/ |
66
|
|
|
protected $title; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @var Collection |
70
|
|
|
*/ |
71
|
|
|
protected $keywords; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* {@inheritDoc} |
75
|
|
|
*/ |
76
|
|
|
public function getHeadline() |
77
|
|
|
{ |
78
|
|
|
return $this->headline; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* {@inheritDoc} |
83
|
|
|
*/ |
84
|
|
|
public function withHeadline(Headline $headline) |
85
|
|
|
{ |
86
|
|
|
$new = clone $this; |
87
|
|
|
$new->headline = $headline; |
88
|
|
|
|
89
|
|
|
return $new; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* {@inheritDoc} |
94
|
|
|
*/ |
95
|
|
|
public function getCredit() |
96
|
|
|
{ |
97
|
|
|
return $this->credit; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* {@inheritDoc} |
102
|
|
|
*/ |
103
|
|
|
public function withCredit(Credit $credit) |
104
|
|
|
{ |
105
|
|
|
$new = clone $this; |
106
|
|
|
$new->credit = $credit; |
107
|
|
|
|
108
|
|
|
return $new; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* {@inheritDoc} |
113
|
|
|
*/ |
114
|
|
|
public function getCopyright() |
115
|
|
|
{ |
116
|
|
|
return $this->copyright; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* {@inheritDoc} |
121
|
|
|
*/ |
122
|
|
|
public function withCopyright(Copyright $copyright) |
123
|
|
|
{ |
124
|
|
|
$new = clone $this; |
125
|
|
|
$new->copyright = $copyright; |
126
|
|
|
|
127
|
|
|
return $new; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* {@inheritDoc} |
132
|
|
|
*/ |
133
|
|
|
public function getCaption() |
134
|
|
|
{ |
135
|
|
|
return $this->caption; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* {@inheritDoc} |
140
|
|
|
*/ |
141
|
|
|
public function withCaption(Caption $caption) |
142
|
|
|
{ |
143
|
|
|
$new = clone $this; |
144
|
|
|
$new->caption = $caption; |
145
|
|
|
|
146
|
|
|
return $new; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* {@inheritDoc} |
151
|
|
|
*/ |
152
|
|
|
public function getTitle() |
153
|
|
|
{ |
154
|
|
|
return $this->title; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* {@inheritDoc} |
159
|
|
|
*/ |
160
|
|
|
public function withTitle(Title $title) |
161
|
|
|
{ |
162
|
|
|
$new = clone $this; |
163
|
|
|
$new->title = $title; |
164
|
|
|
|
165
|
|
|
return $new; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* {@inheritDoc} |
170
|
|
|
*/ |
171
|
|
|
public function getKeywords() |
172
|
|
|
{ |
173
|
|
|
return $this->keywords; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* {@inheritDoc} |
178
|
|
|
*/ |
179
|
|
|
public function withKeywords(Collection $keywords) |
180
|
|
|
{ |
181
|
|
|
$new = clone $this; |
182
|
|
|
$new->keywords = $keywords; |
183
|
|
|
|
184
|
|
|
return $new; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* {@inheritDoc} |
189
|
|
|
*/ |
190
|
|
|
public function getJobtitle() |
191
|
|
|
{ |
192
|
|
|
return $this->jobtitle; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* {@inheritDoc} |
197
|
|
|
*/ |
198
|
|
|
public function withJobtitle(Jobtitle $jobtitle) |
199
|
|
|
{ |
200
|
|
|
$new = clone $this; |
201
|
|
|
$new->jobtitle = $jobtitle; |
202
|
|
|
|
203
|
|
|
return $new; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* {@inheritDoc} |
208
|
|
|
*/ |
209
|
|
|
public function getSource() |
210
|
|
|
{ |
211
|
|
|
return $this->source; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* {@inheritDoc} |
216
|
|
|
*/ |
217
|
|
|
public function withSource(Source $source) |
218
|
|
|
{ |
219
|
|
|
$new = clone $this; |
220
|
|
|
$new->source = $source; |
221
|
|
|
|
222
|
|
|
return $new; |
223
|
|
|
} |
224
|
|
|
} |
225
|
|
|
|