Passed
Push — master ( 663412...3adaf9 )
by Ralf
05:58
created
src/Classes/Domain/Model/Document.php 1 patch
Braces   +61 added lines, -122 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
 /**
21 21
  * Document
22 22
  */
23
-class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
24
-{
23
+class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
25 24
     /**
26 25
      * title
27 26
      *
@@ -183,8 +182,7 @@  discard block
 block discarded – undo
183 182
     /**
184 183
      * __construct
185 184
      */
186
-    public function __construct()
187
-    {
185
+    public function __construct() {
188 186
         //Do not remove the next line: It would break the functionality
189 187
         $this->initStorageObjects();
190 188
     }
@@ -194,8 +192,7 @@  discard block
 block discarded – undo
194 192
      *
195 193
      * @return void
196 194
      */
197
-    protected function initStorageObjects()
198
-    {
195
+    protected function initStorageObjects() {
199 196
         $this->file = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
200 197
     }
201 198
 
@@ -204,8 +201,7 @@  discard block
 block discarded – undo
204 201
      *
205 202
      * @return string $title
206 203
      */
207
-    public function getTitle()
208
-    {
204
+    public function getTitle() {
209 205
         return $this->title;
210 206
     }
211 207
 
@@ -215,8 +211,7 @@  discard block
 block discarded – undo
215 211
      * @param string $title
216 212
      * @return void
217 213
      */
218
-    public function setTitle($title)
219
-    {
214
+    public function setTitle($title) {
220 215
         $this->title = $title;
221 216
         //htmlspecialchars_decode($title,ENT_QUOTES);
222 217
     }
@@ -226,8 +221,7 @@  discard block
 block discarded – undo
226 221
      *
227 222
      * @return array $authors
228 223
      */
229
-    public function getAuthors()
230
-    {
224
+    public function getAuthors() {
231 225
         return array_map('trim', explode(";", $this->authors));
232 226
     }
233 227
 
@@ -237,8 +231,7 @@  discard block
 block discarded – undo
237 231
      * @param array $authors
238 232
      * @return void
239 233
      */
240
-    public function setAuthors($authors)
241
-    {
234
+    public function setAuthors($authors) {
242 235
         $authors = implode("; ", $authors);
243 236
         $this->authors = $authors;
244 237
     }
@@ -248,8 +241,7 @@  discard block
 block discarded – undo
248 241
      *
249 242
      * @return string $xmlData
250 243
      */
251
-    public function getXmlData()
252
-    {
244
+    public function getXmlData() {
253 245
         return $this->xmlData;
254 246
     }
255 247
 
@@ -259,8 +251,7 @@  discard block
 block discarded – undo
259 251
      * @param string $xmlData
260 252
      * @return void
261 253
      */
262
-    public function setXmlData($xmlData)
263
-    {
254
+    public function setXmlData($xmlData) {
264 255
         $this->xmlData = $xmlData;
265 256
     }
266 257
 
@@ -269,8 +260,7 @@  discard block
 block discarded – undo
269 260
      *
270 261
      * @return string $slubInfoData
271 262
      */
272
-    public function getSlubInfoData()
273
-    {
263
+    public function getSlubInfoData() {
274 264
         return $this->slubInfoData;
275 265
     }
276 266
 
@@ -279,8 +269,7 @@  discard block
 block discarded – undo
279 269
      *
280 270
      * @return string $slubInfoData
281 271
      */
282
-    public function setSlubInfoData($slubInfoData)
283
-    {
272
+    public function setSlubInfoData($slubInfoData) {
284 273
         $this->slubInfoData = $slubInfoData;
285 274
     }
286 275
 
@@ -289,8 +278,7 @@  discard block
 block discarded – undo
289 278
      *
290 279
      * @return \EWW\Dpf\Domain\Model\DocumentType $documentType
291 280
      */
292
-    public function getDocumentType()
293
-    {
281
+    public function getDocumentType() {
294 282
         return $this->documentType;
295 283
     }
296 284
 
@@ -300,8 +288,7 @@  discard block
 block discarded – undo
300 288
      * @param \EWW\Dpf\Domain\Model\DocumentType $documentType
301 289
      * @return void
302 290
      */
303
-    public function setDocumentType(\EWW\Dpf\Domain\Model\DocumentType $documentType)
304
-    {
291
+    public function setDocumentType(\EWW\Dpf\Domain\Model\DocumentType $documentType) {
305 292
         $this->documentType = $documentType;
306 293
     }
307 294
 
@@ -310,8 +297,7 @@  discard block
 block discarded – undo
310 297
      *
311 298
      * @return string
312 299
      */
313
-    public function getObjectIdentifier()
314
-    {
300
+    public function getObjectIdentifier() {
315 301
         return $this->objectIdentifier;
316 302
     }
317 303
 
@@ -321,8 +307,7 @@  discard block
 block discarded – undo
321 307
      * @param string $objectIdentifier
322 308
      * @return void
323 309
      */
324
-    public function setObjectIdentifier($objectIdentifier)
325
-    {
310
+    public function setObjectIdentifier($objectIdentifier) {
326 311
         // Due to uniqe key uc_object_identifier, which should ignore empty object identifiers.
327 312
         $this->objectIdentifier = empty($objectIdentifier)? null : $objectIdentifier;
328 313
     }
@@ -332,8 +317,7 @@  discard block
 block discarded – undo
332 317
      *
333 318
      * @return string
334 319
      */
335
-    public function getReservedObjectIdentifier()
336
-    {
320
+    public function getReservedObjectIdentifier() {
337 321
         return $this->reservedObjectIdentifier;
338 322
     }
339 323
 
@@ -343,8 +327,7 @@  discard block
 block discarded – undo
343 327
      * @param string $reservedObjectIdentifier
344 328
      * @return void
345 329
      */
346
-    public function setReservedObjectIdentifier($reservedObjectIdentifier)
347
-    {
330
+    public function setReservedObjectIdentifier($reservedObjectIdentifier) {
348 331
         $this->reservedObjectIdentifier = $reservedObjectIdentifier;
349 332
     }
350 333
 
@@ -353,8 +336,7 @@  discard block
 block discarded – undo
353 336
      *
354 337
      * @return string
355 338
      */
356
-    public function getTransferStatus()
357
-    {
339
+    public function getTransferStatus() {
358 340
         return $this->transferStatus;
359 341
     }
360 342
 
@@ -364,8 +346,7 @@  discard block
 block discarded – undo
364 346
      * @param string
365 347
      * @return void
366 348
      */
367
-    public function setTransferStatus($transferStatus)
368
-    {
349
+    public function setTransferStatus($transferStatus) {
369 350
         $this->transferStatus = $transferStatus;
370 351
     }
371 352
 
@@ -374,8 +355,7 @@  discard block
 block discarded – undo
374 355
      *
375 356
      * @return integer
376 357
      */
377
-    public function getTransferDate()
378
-    {
358
+    public function getTransferDate() {
379 359
         return $this->transferDate;
380 360
     }
381 361
 
@@ -385,8 +365,7 @@  discard block
 block discarded – undo
385 365
      * @param integer $transferDate
386 366
      * @return void
387 367
      */
388
-    public function setTransferDate($transferDate)
389
-    {
368
+    public function setTransferDate($transferDate) {
390 369
         $this->transferDate = $transferDate;
391 370
     }
392 371
 
@@ -395,8 +374,7 @@  discard block
 block discarded – undo
395 374
      *
396 375
      * @var integer
397 376
      */
398
-    public function getTransferErrorCode()
399
-    {
377
+    public function getTransferErrorCode() {
400 378
         return $this->transferErrorCode;
401 379
     }
402 380
 
@@ -406,8 +384,7 @@  discard block
 block discarded – undo
406 384
      * @param integer $transferErrorCode
407 385
      * @return void
408 386
      */
409
-    public function setTransferErrorCode($transferErrorCode)
410
-    {
387
+    public function setTransferErrorCode($transferErrorCode) {
411 388
         $this->transferErrorCode = $transferErrorCode;
412 389
     }
413 390
 
@@ -416,8 +393,7 @@  discard block
 block discarded – undo
416 393
      *
417 394
      * @var string
418 395
      */
419
-    public function getTransferResponse()
420
-    {
396
+    public function getTransferResponse() {
421 397
         return $this->transferResponse;
422 398
     }
423 399
 
@@ -427,8 +403,7 @@  discard block
 block discarded – undo
427 403
      * @param string $transferResponse
428 404
      * @return void
429 405
      */
430
-    public function setTransferResponse($transferResponse)
431
-    {
406
+    public function setTransferResponse($transferResponse) {
432 407
         $this->transferResponse = $transferResponse;
433 408
     }
434 409
 
@@ -437,8 +412,7 @@  discard block
 block discarded – undo
437 412
      *
438 413
      * @var integer
439 414
      */
440
-    public function getTransferHttpStatus()
441
-    {
415
+    public function getTransferHttpStatus() {
442 416
         return $this->transferHttpStatus;
443 417
     }
444 418
 
@@ -448,8 +422,7 @@  discard block
 block discarded – undo
448 422
      * @param integer $transferHttpStatus
449 423
      * @return void
450 424
      */
451
-    public function setTransferHttpStatus($transferHttpStatus)
452
-    {
425
+    public function setTransferHttpStatus($transferHttpStatus) {
453 426
         $this->transferHttpStatus = $transferHttpStatus;
454 427
     }
455 428
 
@@ -459,8 +432,7 @@  discard block
 block discarded – undo
459 432
      * @param \EWW\Dpf\Domain\Model\File $file
460 433
      * @return void
461 434
      */
462
-    public function addFile(\EWW\Dpf\Domain\Model\File $file)
463
-    {
435
+    public function addFile(\EWW\Dpf\Domain\Model\File $file) {
464 436
         $this->file->attach($file);
465 437
     }
466 438
 
@@ -470,8 +442,7 @@  discard block
 block discarded – undo
470 442
      * @param \EWW\Dpf\Domain\Model\File $fileToRemove The File to be removed
471 443
      * @return void
472 444
      */
473
-    public function removeFile(\EWW\Dpf\Domain\Model\File $fileToRemove)
474
-    {
445
+    public function removeFile(\EWW\Dpf\Domain\Model\File $fileToRemove) {
475 446
         $this->file->detach($fileToRemove);
476 447
     }
477 448
 
@@ -480,8 +451,7 @@  discard block
 block discarded – undo
480 451
      *
481 452
      * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\File> $file
482 453
      */
483
-    public function getFile()
484
-    {
454
+    public function getFile() {
485 455
         return $this->file;
486 456
     }
487 457
 
@@ -491,8 +461,7 @@  discard block
 block discarded – undo
491 461
      * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\File> $file
492 462
      * @return void
493 463
      */
494
-    public function setFile(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $file)
495
-    {
464
+    public function setFile(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $file) {
496 465
         $this->file = $file;
497 466
     }
498 467
 
@@ -501,8 +470,7 @@  discard block
 block discarded – undo
501 470
      *
502 471
      * @return array
503 472
      */
504
-    public function getFileData()
505
-    {
473
+    public function getFileData() {
506 474
 
507 475
         $fileId = new \EWW\Dpf\Services\Transfer\FileId($this);
508 476
 
@@ -552,8 +520,7 @@  discard block
 block discarded – undo
552 520
      *
553 521
      * @return array
554 522
      */
555
-    public function getCurrentFileData()
556
-    {
523
+    public function getCurrentFileData() {
557 524
 
558 525
         $fileId = new \EWW\Dpf\Services\Transfer\FileId($this);
559 526
 
@@ -601,8 +568,7 @@  discard block
 block discarded – undo
601 568
      *
602 569
      * @return boolean $changed
603 570
      */
604
-    public function getChanged()
605
-    {
571
+    public function getChanged() {
606 572
         return $this->changed;
607 573
     }
608 574
 
@@ -612,8 +578,7 @@  discard block
 block discarded – undo
612 578
      * @param boolean $changed
613 579
      * @return void
614 580
      */
615
-    public function setChanged($changed)
616
-    {
581
+    public function setChanged($changed) {
617 582
         $this->changed = $changed;
618 583
     }
619 584
 
@@ -622,8 +587,7 @@  discard block
 block discarded – undo
622 587
      *
623 588
      * @return boolean $valid
624 589
      */
625
-    public function getValid()
626
-    {
590
+    public function getValid() {
627 591
         return $this->valid;
628 592
     }
629 593
 
@@ -633,8 +597,7 @@  discard block
 block discarded – undo
633 597
      * @param boolean $valid
634 598
      * @return void
635 599
      */
636
-    public function setValid($valid)
637
-    {
600
+    public function setValid($valid) {
638 601
         $this->valid = $valid;
639 602
     }
640 603
 
@@ -643,8 +606,7 @@  discard block
 block discarded – undo
643 606
      *
644 607
      * @return string
645 608
      */
646
-    public function getDateIssued()
647
-    {
609
+    public function getDateIssued() {
648 610
         return empty($this->dateIssued) ? '' : $this->dateIssued;
649 611
     }
650 612
 
@@ -654,8 +616,7 @@  discard block
 block discarded – undo
654 616
      * @param string $dateIssued
655 617
      * @return void
656 618
      */
657
-    public function setDateIssued($dateIssued)
658
-    {
619
+    public function setDateIssued($dateIssued) {
659 620
         $this->dateIssued = empty($dateIssued) ? '' : $dateIssued;
660 621
     }
661 622
 
@@ -665,8 +626,7 @@  discard block
 block discarded – undo
665 626
      *
666 627
      * @return string
667 628
      */
668
-    public function getProcessNumber()
669
-    {
629
+    public function getProcessNumber() {
670 630
         return $this->processNumber;
671 631
     }
672 632
 
@@ -676,8 +636,7 @@  discard block
 block discarded – undo
676 636
      * @param string $processNumber
677 637
      * @return void
678 638
      */
679
-    public function setProcessNumber($processNumber)
680
-    {
639
+    public function setProcessNumber($processNumber) {
681 640
         $this->processNumber = trim($processNumber);
682 641
     }
683 642
 
@@ -687,8 +646,7 @@  discard block
 block discarded – undo
687 646
      *
688 647
      * @return string
689 648
      */
690
-    public function getSubmitterName()
691
-    {
649
+    public function getSubmitterName() {
692 650
         try {
693 651
             $slub = new \EWW\Dpf\Helper\Slub($this->getSlubInfoData());
694 652
             return $slub->getSubmitterName();
@@ -702,8 +660,7 @@  discard block
 block discarded – undo
702 660
      *
703 661
      * @return string
704 662
      */
705
-    public function getQucosaUrn()
706
-    {
663
+    public function getQucosaUrn() {
707 664
         $mods = new \EWW\Dpf\Helper\Mods($this->getXmlData());
708 665
         return $mods->getQucosaUrn();
709 666
     }
@@ -713,8 +670,7 @@  discard block
 block discarded – undo
713 670
      *
714 671
      * @return int
715 672
      */
716
-    public function getCreator()
717
-    {
673
+    public function getCreator() {
718 674
         return $this->creator? $this->creator : 0;
719 675
     }
720 676
 
@@ -724,23 +680,19 @@  discard block
 block discarded – undo
724 680
      * @param int $creator
725 681
      * @return void
726 682
      */
727
-    public function setCreator($creator)
728
-    {
683
+    public function setCreator($creator) {
729 684
         $this->creator = $creator;
730 685
     }
731 686
 
732
-    public function getState()
733
-    {
687
+    public function getState() {
734 688
         return $this->state;
735 689
     }
736 690
 
737
-    public function setState($state)
738
-    {
691
+    public function setState($state) {
739 692
         $this->state = $state;
740 693
     }
741 694
 
742
-    public function getRemoteState()
743
-    {
695
+    public function getRemoteState() {
744 696
         $state = explode(':', $this->state);
745 697
         if (is_array($state) && array_key_exists(1, $state)) {
746 698
             return $state[1];
@@ -778,8 +730,7 @@  discard block
 block discarded – undo
778 730
     /**
779 731
      * @return string
780 732
      */
781
-    public function getRemoteLastModDate()
782
-    {
733
+    public function getRemoteLastModDate() {
783 734
         return $this->remoteLastModDate;
784 735
     }
785 736
 
@@ -787,16 +738,14 @@  discard block
 block discarded – undo
787 738
      * @param string $remoteLastModDate
788 739
      * @return void
789 740
      */
790
-    public function setRemoteLastModDate($remoteLastModDate)
791
-    {
741
+    public function setRemoteLastModDate($remoteLastModDate) {
792 742
         $this->remoteLastModDate = $remoteLastModDate;
793 743
     }
794 744
 
795 745
     /**
796 746
      * @return integer
797 747
      */
798
-    public function getTstamp()
799
-    {
748
+    public function getTstamp() {
800 749
         return $this->tstamp;
801 750
     }
802 751
 
@@ -811,8 +760,7 @@  discard block
 block discarded – undo
811 760
     /**
812 761
      * @param bool $suggestion
813 762
      */
814
-    public function setSuggestion(bool $suggestion)
815
-    {
763
+    public function setSuggestion(bool $suggestion) {
816 764
         $this->suggestion = $suggestion;
817 765
     }
818 766
 
@@ -827,8 +775,7 @@  discard block
 block discarded – undo
827 775
     /**
828 776
      * @param string $linkedUid
829 777
      */
830
-    public function setLinkedUid(string $linkedUid)
831
-    {
778
+    public function setLinkedUid(string $linkedUid) {
832 779
         $this->linkedUid = $linkedUid;
833 780
     }
834 781
 
@@ -843,8 +790,7 @@  discard block
 block discarded – undo
843 790
     /**
844 791
      * @param string $comment
845 792
      */
846
-    public function setComment(string $comment)
847
-    {
793
+    public function setComment(string $comment) {
848 794
         $this->comment = $comment;
849 795
     }
850 796
 
@@ -881,8 +827,7 @@  discard block
 block discarded – undo
881 827
      *
882 828
      * @return string|int
883 829
      */
884
-    public function getDocumentIdentifier()
885
-    {
830
+    public function getDocumentIdentifier() {
886 831
         return $this->getObjectIdentifier()? $this->getObjectIdentifier() : $this->getUid();
887 832
     }
888 833
 
@@ -891,8 +836,7 @@  discard block
 block discarded – undo
891 836
      *
892 837
      * @return bool
893 838
      */
894
-    public function isWorkingCopy()
895
-    {
839
+    public function isWorkingCopy() {
896 840
         return $this->getObjectIdentifier() && !$this->isTemporary() && !$this->isSuggestion();
897 841
     }
898 842
 
@@ -902,8 +846,7 @@  discard block
 block discarded – undo
902 846
      *
903 847
      * @return bool
904 848
      */
905
-    public function isTemporaryCopy()
906
-    {
849
+    public function isTemporaryCopy() {
907 850
         return $this->getObjectIdentifier() && $this->isTemporary() && !$this->isSuggestion();
908 851
     }
909 852
 
@@ -913,8 +856,7 @@  discard block
 block discarded – undo
913 856
      *
914 857
      * @return string|null
915 858
      */
916
-    public function getPublicationYear()
917
-    {
859
+    public function getPublicationYear() {
918 860
         $mods = new Mods($this->getXmlData());
919 861
         $year =  $mods->getPublishingYear();
920 862
         return $year? $year : "";
@@ -925,8 +867,7 @@  discard block
 block discarded – undo
925 867
      *
926 868
      * @return string|null
927 869
      */
928
-    public function getMainTitle()
929
-    {
870
+    public function getMainTitle() {
930 871
         $mods = new Mods($this->getXmlData());
931 872
         $title = $mods->getTitle();
932 873
         return $title? $title : "";
@@ -938,8 +879,7 @@  discard block
 block discarded – undo
938 879
      *
939 880
      * @return string|null
940 881
      */
941
-    public function getSourceDetails()
942
-    {
882
+    public function getSourceDetails() {
943 883
         $mods = new Mods($this->getXmlData());
944 884
         $data = $mods->getSourceDetails();
945 885
         return $data;
@@ -956,8 +896,7 @@  discard block
 block discarded – undo
956 896
     /**
957 897
      * @param \DateTime|null $embargoDate
958 898
      */
959
-    public function setEmbargoDate(?\DateTime $embargoDate)
960
-    {
899
+    public function setEmbargoDate(?\DateTime $embargoDate) {
961 900
         $this->embargoDate = $embargoDate;
962 901
     }
963 902
 
Please login to merge, or discard this patch.