1 | <?php |
||
22 | final class Iptc implements IptcInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $caption; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $copyright; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $credit; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $headline; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | private $jobtitle; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | private $keywords = array(); |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | private $source; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | */ |
||
62 | private $title; |
||
63 | |||
64 | /** |
||
65 | * Contains the mapping of names to IPTC field numbers |
||
66 | * |
||
67 | * @var array |
||
68 | */ |
||
69 | public static $iptcMapping = array( |
||
70 | 'caption' => '2#120', |
||
71 | 'copyright' => '2#116', |
||
72 | 'credit' => '2#110', |
||
73 | 'headline' => '2#105', |
||
74 | 'jobtitle' => '2#085', |
||
75 | 'keywords' => '2#025', |
||
76 | 'source' => '2#115', |
||
77 | 'title' => '2#005', |
||
78 | ); |
||
79 | |||
80 | /** |
||
81 | * @param array $data |
||
82 | */ |
||
83 | public function __construct(array $data = array()) |
||
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | public function toArray($withEmpty = true) |
||
114 | |||
115 | /** |
||
116 | * {@inheritDoc} |
||
117 | */ |
||
118 | public function getCaption() |
||
122 | |||
123 | /** |
||
124 | * {@inheritDoc} |
||
125 | */ |
||
126 | public function withCaption($caption) |
||
133 | |||
134 | /** |
||
135 | * {@inheritDoc} |
||
136 | */ |
||
137 | public function getCopyright() |
||
141 | |||
142 | /** |
||
143 | * {@inheritDoc} |
||
144 | */ |
||
145 | public function withCopyright($copyright) |
||
152 | |||
153 | /** |
||
154 | * {@inheritDoc} |
||
155 | */ |
||
156 | public function getCredit() |
||
160 | |||
161 | /** |
||
162 | * {@inheritDoc} |
||
163 | */ |
||
164 | public function withCredit($credit) |
||
171 | |||
172 | /** |
||
173 | * {@inheritDoc} |
||
174 | */ |
||
175 | public function getHeadline() |
||
179 | |||
180 | /** |
||
181 | * {@inheritDoc} |
||
182 | */ |
||
183 | public function withHeadline($headline) |
||
190 | |||
191 | /** |
||
192 | * {@inheritDoc} |
||
193 | */ |
||
194 | public function getJobtitle() |
||
198 | |||
199 | /** |
||
200 | * {@inheritDoc} |
||
201 | */ |
||
202 | public function withJobtitle($jobtitle) |
||
209 | |||
210 | /** |
||
211 | * {@inheritDoc} |
||
212 | */ |
||
213 | public function getKeywords() |
||
217 | |||
218 | /** |
||
219 | * {@inheritDoc} |
||
220 | */ |
||
221 | public function withKeywords(array $keywords) |
||
228 | |||
229 | /** |
||
230 | * {@inheritDoc} |
||
231 | */ |
||
232 | public function getSource() |
||
236 | |||
237 | /** |
||
238 | * {@inheritDoc} |
||
239 | */ |
||
240 | public function withSource($source) |
||
247 | |||
248 | /** |
||
249 | * {@inheritDoc} |
||
250 | */ |
||
251 | public function getTitle() |
||
255 | |||
256 | /** |
||
257 | * {@inheritDoc} |
||
258 | */ |
||
259 | public function withTitle($title) |
||
266 | } |
||
267 |