19
19
20
20
namespace PhpOffice \PhpPresentation ;
21
21
22
- /**
23
- * \PhpOffice\PhpPresentation\DocumentProperties.
24
- */
25
22
class DocumentProperties
26
23
{
27
24
public const PROPERTY_TYPE_BOOLEAN = 'b ' ;
@@ -36,14 +33,14 @@ class DocumentProperties
36
33
*
37
34
* @var string
38
35
*/
39
- private $ creator ;
36
+ private $ creator = ' Unknown Creator ' ;
40
37
41
38
/**
42
39
* LastModifiedBy.
43
40
*
44
41
* @var string
45
42
*/
46
- private $ lastModifiedBy ;
43
+ private $ lastModifiedBy = ' Unknown Creator ' ;
47
44
48
45
/**
49
46
* Created.
@@ -64,56 +61,56 @@ class DocumentProperties
64
61
*
65
62
* @var string
66
63
*/
67
- private $ title ;
64
+ private $ title = ' Untitled Presentation ' ;
68
65
69
66
/**
70
67
* Description.
71
68
*
72
69
* @var string
73
70
*/
74
- private $ description ;
71
+ private $ description = '' ;
75
72
76
73
/**
77
74
* Subject.
78
75
*
79
76
* @var string
80
77
*/
81
- private $ subject ;
78
+ private $ subject = '' ;
82
79
83
80
/**
84
81
* Keywords.
85
82
*
86
83
* @var string
87
84
*/
88
- private $ keywords ;
85
+ private $ keywords = '' ;
89
86
90
87
/**
91
88
* Category.
92
89
*
93
90
* @var string
94
91
*/
95
- private $ category ;
92
+ private $ category = '' ;
96
93
97
94
/**
98
95
* Company.
99
96
*
100
97
* @var string
101
98
*/
102
- private $ company ;
99
+ private $ company = ' Unknown Company ' ;
103
100
104
101
/**
105
102
* Revision.
106
103
*
107
104
* @var string
108
105
*/
109
- private $ revision ;
106
+ private $ revision = '' ;
110
107
111
108
/**
112
109
* Status.
113
110
*
114
111
* @var string
115
112
*/
116
- private $ status ;
113
+ private $ status = '' ;
117
114
118
115
/**
119
116
* Custom Properties.
@@ -125,29 +122,20 @@ class DocumentProperties
125
122
/**
126
123
* Create a new \PhpOffice\PhpPresentation\DocumentProperties.
127
124
*/
125
+ private $ generator = '' ;
126
+
128
127
public function __construct ()
129
128
{
130
- // Initialise values
131
- $ this ->creator = 'Unknown Creator ' ;
132
- $ this ->lastModifiedBy = $ this ->creator ;
133
129
$ this ->created = time ();
134
130
$ this ->modified = time ();
135
- $ this ->title = 'Untitled Presentation ' ;
136
- $ this ->subject = '' ;
137
- $ this ->description = '' ;
138
- $ this ->keywords = '' ;
139
- $ this ->category = '' ;
140
- $ this ->company = 'Microsoft Corporation ' ;
141
- $ this ->revision = '' ;
142
- $ this ->status = '' ;
143
131
}
144
132
145
133
/**
146
134
* Get Creator.
147
135
*
148
136
* @return string
149
137
*/
150
- public function getCreator ()
138
+ public function getCreator (): string
151
139
{
152
140
return $ this ->creator ;
153
141
}
@@ -157,9 +145,9 @@ public function getCreator()
157
145
*
158
146
* @param string $pValue
159
147
*
160
- * @return DocumentProperties
148
+ * @return self
161
149
*/
162
- public function setCreator ($ pValue = '' )
150
+ public function setCreator (string $ pValue = '' ): self
163
151
{
164
152
$ this ->creator = $ pValue ;
165
153
@@ -171,7 +159,7 @@ public function setCreator($pValue = '')
171
159
*
172
160
* @return string
173
161
*/
174
- public function getLastModifiedBy ()
162
+ public function getLastModifiedBy (): string
175
163
{
176
164
return $ this ->lastModifiedBy ;
177
165
}
@@ -181,9 +169,9 @@ public function getLastModifiedBy()
181
169
*
182
170
* @param string $pValue
183
171
*
184
- * @return DocumentProperties
172
+ * @return self
185
173
*/
186
- public function setLastModifiedBy ($ pValue = '' )
174
+ public function setLastModifiedBy (string $ pValue = '' ): self
187
175
{
188
176
$ this ->lastModifiedBy = $ pValue ;
189
177
@@ -195,7 +183,7 @@ public function setLastModifiedBy($pValue = '')
195
183
*
196
184
* @return int
197
185
*/
198
- public function getCreated ()
186
+ public function getCreated (): int
199
187
{
200
188
return $ this ->created ;
201
189
}
@@ -205,9 +193,9 @@ public function getCreated()
205
193
*
206
194
* @param int $pValue
207
195
*
208
- * @return DocumentProperties
196
+ * @return self
209
197
*/
210
- public function setCreated ($ pValue = null )
198
+ public function setCreated (int $ pValue = null ): self
211
199
{
212
200
if (null === $ pValue ) {
213
201
$ pValue = time ();
@@ -222,7 +210,7 @@ public function setCreated($pValue = null)
222
210
*
223
211
* @return int
224
212
*/
225
- public function getModified ()
213
+ public function getModified (): int
226
214
{
227
215
return $ this ->modified ;
228
216
}
@@ -232,9 +220,9 @@ public function getModified()
232
220
*
233
221
* @param int $pValue
234
222
*
235
- * @return DocumentProperties
223
+ * @return self
236
224
*/
237
- public function setModified ($ pValue = null )
225
+ public function setModified (int $ pValue = null ): self
238
226
{
239
227
if (null === $ pValue ) {
240
228
$ pValue = time ();
@@ -249,7 +237,7 @@ public function setModified($pValue = null)
249
237
*
250
238
* @return string
251
239
*/
252
- public function getTitle ()
240
+ public function getTitle (): string
253
241
{
254
242
return $ this ->title ;
255
243
}
@@ -259,9 +247,9 @@ public function getTitle()
259
247
*
260
248
* @param string $pValue
261
249
*
262
- * @return DocumentProperties
250
+ * @return self
263
251
*/
264
- public function setTitle ($ pValue = '' )
252
+ public function setTitle (string $ pValue = '' ): self
265
253
{
266
254
$ this ->title = $ pValue ;
267
255
@@ -273,7 +261,7 @@ public function setTitle($pValue = '')
273
261
*
274
262
* @return string
275
263
*/
276
- public function getDescription ()
264
+ public function getDescription (): string
277
265
{
278
266
return $ this ->description ;
279
267
}
@@ -283,9 +271,9 @@ public function getDescription()
283
271
*
284
272
* @param string $pValue
285
273
*
286
- * @return DocumentProperties
274
+ * @return self
287
275
*/
288
- public function setDescription ($ pValue = '' )
276
+ public function setDescription (string $ pValue = '' ): self
289
277
{
290
278
$ this ->description = $ pValue ;
291
279
@@ -297,7 +285,7 @@ public function setDescription($pValue = '')
297
285
*
298
286
* @return string
299
287
*/
300
- public function getSubject ()
288
+ public function getSubject (): string
301
289
{
302
290
return $ this ->subject ;
303
291
}
@@ -307,9 +295,9 @@ public function getSubject()
307
295
*
308
296
* @param string $pValue
309
297
*
310
- * @return DocumentProperties
298
+ * @return self
311
299
*/
312
- public function setSubject ($ pValue = '' )
300
+ public function setSubject (string $ pValue = '' ): self
313
301
{
314
302
$ this ->subject = $ pValue ;
315
303
@@ -321,7 +309,7 @@ public function setSubject($pValue = '')
321
309
*
322
310
* @return string
323
311
*/
324
- public function getKeywords ()
312
+ public function getKeywords (): string
325
313
{
326
314
return $ this ->keywords ;
327
315
}
@@ -331,9 +319,9 @@ public function getKeywords()
331
319
*
332
320
* @param string $pValue
333
321
*
334
- * @return DocumentProperties
322
+ * @return self
335
323
*/
336
- public function setKeywords ($ pValue = '' )
324
+ public function setKeywords (string $ pValue = '' ): self
337
325
{
338
326
$ this ->keywords = $ pValue ;
339
327
@@ -345,7 +333,7 @@ public function setKeywords($pValue = '')
345
333
*
346
334
* @return string
347
335
*/
348
- public function getCategory ()
336
+ public function getCategory (): string
349
337
{
350
338
return $ this ->category ;
351
339
}
@@ -355,9 +343,9 @@ public function getCategory()
355
343
*
356
344
* @param string $pValue
357
345
*
358
- * @return DocumentProperties
346
+ * @return self
359
347
*/
360
- public function setCategory ($ pValue = '' )
348
+ public function setCategory (string $ pValue = '' ): self
361
349
{
362
350
$ this ->category = $ pValue ;
363
351
@@ -369,7 +357,7 @@ public function setCategory($pValue = '')
369
357
*
370
358
* @return string
371
359
*/
372
- public function getCompany ()
360
+ public function getCompany (): string
373
361
{
374
362
return $ this ->company ;
375
363
}
@@ -379,9 +367,9 @@ public function getCompany()
379
367
*
380
368
* @param string $pValue
381
369
*
382
- * @return DocumentProperties
370
+ * @return self
383
371
*/
384
- public function setCompany ($ pValue = '' )
372
+ public function setCompany (string $ pValue = '' ): self
385
373
{
386
374
$ this ->company = $ pValue ;
387
375
@@ -505,4 +493,28 @@ public function setStatus(string $pValue = ''): self
505
493
506
494
return $ this ;
507
495
}
496
+
497
+ /**
498
+ * Get Generator.
499
+ *
500
+ * @return string
501
+ */
502
+ public function getGenerator (): string
503
+ {
504
+ return $ this ->generator ;
505
+ }
506
+
507
+ /**
508
+ * Set Generator.
509
+ *
510
+ * @param string $pValue
511
+ *
512
+ * @return self
513
+ */
514
+ public function setGenerator (string $ pValue = '' ): self
515
+ {
516
+ $ this ->generator = $ pValue ;
517
+
518
+ return $ this ;
519
+ }
508
520
}
0 commit comments