Extension.php 21.2 KB
Newer Older
1
<?php
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
2

3
4
namespace T3o\TerFe2\Domain\Model;

5
6
/*
 * This file is part of the TYPO3 CMS project.
7
 *
8
9
10
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
11
 *
12
13
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
16
 * The TYPO3 project - inspiring people to share!
 */
17

18
19
use T3o\TerFe2\Domain\Repository\DownloadRepository;
use T3o\TerFe2\Utility\VersionUtility;
20
use T3o\TerRest\DTO\Extension as ExtensionDto;
21
22
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
23
24
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;

25
26
27
/**
 * Extension container
 */
28
class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements \JsonSerializable
29
30
31
{
    /**
     * Extension key
32
     *
33
34
     * @var string
     */
35
    protected $extKey = '';
36
37
38
39
40

    /**
     * Link to forge project
     *
     * @var string
41
     * @TYPO3\CMS\Extbase\Annotation\Validate("\T3o\TerFe2\Validation\Validator\UrlValidator")
42
     */
43
    protected $forgeLink = '';
44
45
46

    /**
     * Tags
47
     *
48
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag>
49
     */
50
    protected $tags;
51
52
53

    /**
     * Versions
54
     *
55
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
56
     * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
57
     */
58
    protected $versions;
59
60
61

    /**
     * Last version
62
     *
63
     * @var \T3o\TerFe2\Domain\Model\Version
64
     */
65
    protected $lastVersion;
66
67
68

    /**
     * Frontend user
69
     *
70
71
     * @var string
     */
72
    protected $frontendUser = '';
73
74
75

    /**
     * Sum of all version downloads
76
     *
77
     * @var int
78
     */
79
    protected $downloads = 0;
80
81
82

    /**
     * Creation date
83
84
     *
     * @var \DateTime
85
     */
86
    protected $crdate;
87
88
89
90
91

    /**
     * Link to an external repository
     *
     * @var string
92
     * @TYPO3\CMS\Extbase\Annotation\Validate("\T3o\TerFe2\Validation\Validator\UrlValidator")
93
     */
94
    protected $repositoryUrl = '';
95
96
97
98
99

    /**
     * Link to an external manual
     *
     * @var string
100
     * @TYPO3\CMS\Extbase\Annotation\Validate("\T3o\TerFe2\Validation\Validator\UrlValidator")
101
     */
102
    protected $externalManual = '';
103
104
105
106
107

    /**
     * Link to paypal donation
     *
     * @var string
108
     * @TYPO3\CMS\Extbase\Annotation\Validate("\T3o\TerFe2\Validation\Validator\UrlValidator")
109
     */
110
    protected $paypalUrl = '';
111

112
113
114
115
116
    /**
     * @var string
     */
    protected $securityTeamNotice = '';

117
118
119
    /**
     * @var \DateTime
     */
120
    protected $expire;
121

122
123
124
125
    /**
     * Composer name of extension on packagist.org
     *
     * @var string
126
     * @TYPO3\CMS\Extbase\Annotation\Validate("\T3o\TerFe2\Validation\Validator\ComposerNameValidator")
127
128
129
     */
    protected $composerName = '';

Thomas Löffler's avatar
Thomas Löffler committed
130
131
132
133
134
    /**
     * @var int
     */
    protected $likes = 0;

135
136
137
138
139
    /**
     * @var int
     */
    protected $notifications = 0;

140
141
142
143
144
145
146
147
148
149
    /**
     * @var string
     */
    protected $localizationStatus = '';

    /**
     * @var string
     */
    protected $crowdinKey = '';

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
    /**
     * @var int
     */
    protected $lastDownloadSync;

    /**
     * @var DownloadRepository
     */
    protected $downloadRepository;

    public function injectDownloadRepository(DownloadRepository $downloadRepository)
    {
        $this->downloadRepository = $downloadRepository;
    }

165
    /**
166
     * Initialize all ObjectStorage instances.
167
168
169
     */
    public function __construct()
    {
170
171
        $this->tags = new ObjectStorage();
        $this->versions = new ObjectStorage();
172
173
174
175
176
177
178
    }

    /**
     * Setter for extKey
     *
     * @param string $extKey extKey
     */
179
    public function setExtKey(string $extKey)
180
181
182
183
184
185
186
187
188
    {
        $this->extKey = $extKey;
    }

    /**
     * Getter for extKey
     *
     * @return string extKey
     */
189
    public function getExtKey(): string
190
191
192
193
194
195
196
197
198
    {
        return $this->extKey;
    }

    /**
     * Setter for forgeLink
     *
     * @param string $forgeLink forgeLink
     */
199
    public function setForgeLink(string $forgeLink)
200
201
202
203
204
205
206
207
208
    {
        $this->forgeLink = $forgeLink;
    }

    /**
     * Getter for forgeLink
     *
     * @return string forgeLink
     */
209
    public function getForgeLink(): string
210
211
212
213
214
215
216
    {
        return $this->forgeLink;
    }

    /**
     * Setter for crdate
     *
217
     * @param \DateTime $crdate creation date
218
     */
219
    public function setCrdate(\DateTime $crdate)
220
221
222
223
224
225
226
    {
        $this->crdate = $crdate;
    }

    /**
     * Getter for crdate
     *
227
     * @return \DateTime crdate
228
     */
229
    public function getCrdate(): \DateTime
230
231
232
233
234
235
236
    {
        return $this->crdate;
    }

    /**
     * Getter for tags
     *
237
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag> Tags
238
     */
239
    public function getTags(): ObjectStorage
240
241
242
243
244
245
246
    {
        return $this->tags;
    }

    /**
     * Adds a Tag
     *
247
     * @param \T3o\TerFe2\Domain\Model\Tag $tag The tag to be added
248
     */
249
    public function addTag(Tag $tag)
250
251
252
253
254
255
256
    {
        $this->tags->attach($tag);
    }

    /**
     * Removes a Tag
     *
257
     * @param \T3o\TerFe2\Domain\Model\Tag $tag The tag to be removed
258
     */
259
    public function removeTag(Tag $tag)
260
261
262
263
264
265
266
    {
        $this->tags->detach($tag);
    }

    /**
     * Getter for versions
     *
267
     * @return Version[]|\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
268
     */
269
    public function getVersions(): ObjectStorage
270
271
272
273
    {
        return $this->versions;
    }

274
275
276
277
278
279
280
281
282
    /**
     * Getter for a single version
     *
     * @param mixed $identifier Either the version number (e.g. 1000001) or the version string (e.g. 1.0.1)
     * @return Version|null
     */
    public function getVersion($identifier): ?Version
    {
        foreach ($this->versions as $version) {
283
284
285
286
            if ($version instanceof Version
                && ((is_int($identifier) && $version->getVersionNumber() === $identifier)
                    || (is_string($identifier) && $version->getVersionString() === $identifier))

287
288
289
290
291
292
293
294
            ) {
                return $version;
            }
        }

        return null;
    }

295
296
297
298
299
    /**
     * Get versions reverse sorted by version number
     *
     * @return array Versions
     */
300
    public function getReverseVersionsWithPositiveReviewsByVersionNumber(): array
301
    {
302
        $versions = [];
303
304
305
306
307
308
309
310

        foreach ($this->versions as $version) {
            if ($version->getReviewState() > -1) {
                $versions[$version->getVersionNumber()] = $version;
            }
        }

        krsort($versions);
311

312
313
314
315
316
317
        return $versions;
    }

    /**
     * Get versions reverse sorted by version number
     *
318
319
     * @param int $limit
     * @param bool $reverseAfterSlice
320
     * @return array|\T3o\TerFe2\Domain\Model\Version[] Versions
321
     */
322
    public function getReverseVersionsByVersionNumber(int $limit = 0, bool $reverseAfterSlice = true): array
323
    {
324
        $versions = [];
325
326
327
328
329

        foreach ($this->versions as $version) {
            $versions[$version->getVersionNumber()] = $version;
        }
        krsort($versions);
330
331
332
333
334
335
336
        if ($limit > 0) {
            $versions = array_slice($versions, 0, $limit, true);
            if ($reverseAfterSlice) {
                $versions = array_reverse($versions);
            }
        }

337
338
339
340
341
342
        return $versions;
    }

    /**
     * Returns the count of versions
     *
343
     * @return int Version count
344
     */
345
    public function getVersionCount(): int
346
    {
347
        return count($this->versions);
348
349
350
351
352
    }

    /**
     * Adds a Version
     *
353
     * @param \T3o\TerFe2\Domain\Model\Version $version The version to be added
354
     */
355
    public function addVersion(Version $version)
356
357
358
    {
        $this->versions->attach($version);
        $this->setLastVersion($version);
359
        $this->addDownloads($version->getAllDownloads());
360
361
362
363
364
    }

    /**
     * Removes a Version
     *
365
     * @param \T3o\TerFe2\Domain\Model\Version $version
366
     */
367
    public function removeVersion(Version $version)
368
369
    {
        if (!$this->versions->contains($version)) {
370
            throw new \UnexpectedValueException('Tried to remove a version which is not part of the extension.', 1339359060);
371
372
373
374
        }

        $versionCount = $this->getVersionCount();
        $this->versions->detach($version);
375
        if ($version === $this->lastVersion) {
376
            if ($versionCount === 1) {
Markus Sommer's avatar
Markus Sommer committed
377
                $this->lastVersion = null;
378
            } else {
379
380
                $reverseVersionsByVersionNumber = $this->getReverseVersionsByVersionNumber();
                $this->lastVersion = array_shift($reverseVersionsByVersionNumber);
381
382
383
384
385
386
387
            }
        }
    }

    /**
     * Setter for lastVersion, will only set if given version is newer than existing one
     *
388
     * @param \T3o\TerFe2\Domain\Model\Version $lastVersion lastVersion
389
     */
390
    public function setLastVersion(Version $lastVersion)
391
    {
392
        $this->lastVersion = $lastVersion;
393
394
395
396
397
    }

    /**
     * Getter for lastVersion
     *
398
     * @return \T3o\TerFe2\Domain\Model\Version lastVersion
399
     */
Thomas Löffler's avatar
Thomas Löffler committed
400
    public function getLastVersion()
401
402
403
404
405
406
407
408
409
    {
        return $this->lastVersion;
    }

    /**
     * Setter for frontendUser
     *
     * @param string $frontendUser Frontend user
     */
410
    public function setFrontendUser(string $frontendUser)
411
412
413
414
415
416
417
418
419
    {
        $this->frontendUser = $frontendUser;
    }

    /**
     * Getter for frontendUser
     *
     * @return string Frontend user
     */
420
    public function getFrontendUser(): string
421
422
423
424
425
426
427
428
429
    {
        return $this->frontendUser;
    }

    /**
     * Sets externalManual
     *
     * @param string $externalManual
     */
430
    public function setExternalManual(string $externalManual)
431
432
433
434
435
436
437
438
439
    {
        $this->externalManual = $externalManual;
    }

    /**
     * Gets externalManual
     *
     * @return string
     */
440
    public function getExternalManual(): string
441
442
443
444
445
446
447
448
449
    {
        return $this->externalManual;
    }

    /**
     * Sets paypalUrl
     *
     * @param string $paypalUrl
     */
450
    public function setPaypalUrl(string $paypalUrl)
451
452
453
454
455
456
457
458
459
    {
        $this->paypalUrl = $paypalUrl;
    }

    /**
     * Gets paypalUrl
     *
     * @return string
     */
460
    public function getPaypalUrl(): string
461
462
463
464
465
466
467
468
469
    {
        return $this->paypalUrl;
    }

    /**
     * Sets repositoryUrl
     *
     * @param string $repositoryUrl
     */
470
    public function setRepositoryUrl(string $repositoryUrl)
471
472
473
474
475
476
477
478
479
    {
        $this->repositoryUrl = $repositoryUrl;
    }

    /**
     * Gets repositoryUrl
     *
     * @return string
     */
480
    public function getRepositoryUrl(): string
481
482
483
484
485
486
487
488
489
    {
        return $this->repositoryUrl;
    }

    /**
     * Returns all votes for the extension
     *
     * @return array Vote counts
     */
490
    public function getVotes(): array
491
    {
492
        $votes = [
493
494
            'positive' => 0,
            'negative' => 0,
495
        ];
496
497
498
499
500
501
502

        foreach ($this->versions as $version) {
            $experiences = $version->getExperiences();
            if (!is_array($experiences)) {
                continue;
            }
            foreach ($experiences as $experience) {
503
                $rating = $experience->getRating();
504
505
506
507
508
509
510
511
512
513
514
515
516
517
                if ($rating > 0) {
                    $votes['positive'] += $rating;
                } else {
                    $votes['negative'] += $rating;
                }
            }
        }

        return $votes;
    }

    /**
     * Set all downloads sum
     *
518
     * @param int $downloads Count of downloads
519
     */
520
    public function setDownloads(int $downloads)
521
    {
522
        $this->downloads = $downloads;
523
524
525
526
527
    }

    /**
     * Get sum of all version downloads
     *
528
     * @return int All downloads
529
     */
530
    public function getDownloads(): int
531
532
533
534
535
536
537
    {
        $downloads = $this->downloadRepository->findDownloadsByExtensionkey($this->getExtKey());

        return $this->downloads + $downloads;
    }

    public function getOldDownloads(): int
538
    {
539
        return $this->downloads;
540
541
542
543
544
    }

    /**
     * Add downloads to all downloads sum
     *
545
     * @param int $downloads Count of downloads to add
546
     */
547
    public function addDownloads(int $downloads)
548
    {
549
        $this->downloads += $downloads;
550
551
552
553
554
    }

    /**
     * @return \DateTime
     */
555
    public function getExpire(): \DateTime
556
    {
557
558
559
560
        if ($this->expire === null) {
            $this->expire = new \DateTime();
            $this->expire->setTimestamp(0);
        }
561
562
563
564
        return $this->expire;
    }

    /**
565
     * @param \DateTime|null $expire
566
     */
567
    public function setExpire(\DateTime $expire = null)
568
    {
569
570
571
572
        if ($expire === null) {
            $expire = new \DateTime();
            $expire->setTimestamp(0);
        }
573
574
575
576
577
578
579
580
581
582
583
584
        $this->expire = $expire;
    }

    /**
     * Recalculate sum of all downloads
     */
    public function recalculateDownloads()
    {
        $downloads = 0;
        $versions = $this->getVersions();

        foreach ($versions as $version) {
585
            $downloads += $version->getAllDownloads();
586
587
588
589
590
591
        }

        if (!empty($downloads)) {
            $this->setDownloads($downloads);
        }
    }
592
593
594
595
596

    /**
     * @param int $versionCount
     * @return string
     */
597
    public function getDownloadsByVersionsAsJson($versionCount = 6): string
598
599
600
601
602
    {
        if (empty($this->versions)) {
            return '';
        }
        $versions = [];
603
        foreach ($this->getReverseVersionsByVersionNumber($versionCount) as $version) {
604
605
606
607
608
609
610
611
612
613
614
            /** @var \T3o\TerFe2\Domain\Model\Version $version */
            $versions['release'][$version->getUploadDate()] = date('d-m-Y', $version->getUploadDate());
            $versions['versions'][] = $version->getVersionString();
            $versions['downloads'][] = $version->getAllDownloads();
        }
        $versions['release'] = array_splice($versions['release'], $versionCount * -1);
        $versions['versions'] = array_splice($versions['versions'], $versionCount * -1);
        $versions['downloads'] = array_splice($versions['downloads'], $versionCount * -1);

        return json_encode($versions);
    }
615

616
617
618
619
620
    /**
     * @return string
     */
    public function getDownloadsByTimeIntervalAsJson(): string
    {
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
621
        if (empty($this->versions)) {
622
623
624
625
626
627
            return '';
        }

        $intervals = [];

        // The for loop is turned around to ensure the sorting order in the multi dimensional array.
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
628
629
        for ($i = 5; $i >= 0; $i--) {
            $time = strtotime('-' . $i . 'month');
630
            $month = date('Ym', $time);
631
632
633
634
635
            $downloadsPackagist = $this->downloadRepository->findDownloadCounterByMonthAndExtensionKeyAndSource($month, $this->getExtKey(), VersionUtility::DOWNLOAD_SOURCE_PACKAGIST);
            $downloadsTer = $this->downloadRepository->findDownloadCounterByMonthAndExtensionKeyAndSource($month, $this->getExtKey(), VersionUtility::DOWNLOAD_SOURCE_TER);
            $downloadsEm = $this->downloadRepository->findDownloadCounterByMonthAndExtensionKeyAndSource($month, $this->getExtKey(), VersionUtility::DOWNLOAD_SOURCE_EM);

            // How to define the start date for the feature?
636
            if ($downloadsPackagist === 0 && $downloadsTer === 0 && $downloadsEm === 0) {
637
638
639
640
                continue;
            }

            $intervals['release'][] = date('M. Y', $time);
641
642
643
            $intervals['downloadsPackagist'][] = $downloadsPackagist;
            $intervals['downloadsTER'][] = $downloadsTer;
            $intervals['downloadsEM'][] = $downloadsEm;
644
645
646
647
648
649
            $intervals['versions'][] = '';
        }

        return json_encode($intervals);
    }

650
651
652
653
654
    /**
     * @return \DateTime|null
     */
    public function getDateOfFirstUpload()
    {
655
656
        $dateOfFirstUpload = null;

657
        $versions = array_reverse($this->getReverseVersionsByVersionNumber());
658
        [$firstVersion] = $versions;
659
660
661

        if (!empty($firstVersion)) {
            $dateOfFirstUpload = date('d-m-Y', $firstVersion->getUploadDate());
662
663
664
665
        }

        return $dateOfFirstUpload;
    }
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681

    /**
     * @return string
     */
    public function getComposerName()
    {
        return $this->composerName;
    }

    /**
     * @param string $composerName
     */
    public function setComposerName($composerName)
    {
        $this->composerName = $composerName;
    }
Thomas Löffler's avatar
Thomas Löffler committed
682

683
684
685
    /**
     * @return string
     */
686
    public function getPackagistPage(): string
687
    {
688
689
690
        if (empty($this->composerName)) {
            return '';
        }
691
692
693
        return 'https://packagist.org/packages/' . $this->composerName;
    }

Thomas Löffler's avatar
Thomas Löffler committed
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
    /**
     * @return int
     */
    public function getLikes()
    {
        return $this->likes;
    }

    /**
     * @param int $likes
     */
    public function setLikes(int $likes)
    {
        $this->likes = $likes;
    }

    public function increaseLikes()
    {
        $this->likes++;
    }

    public function decreaseLikes()
    {
        if ($this->likes > 0) {
            $this->likes--;
        }
    }
721
722
723
724
725
726
727
728
729
730

    public function getNotifications(): int
    {
        return $this->notifications;
    }

    public function setNotifications(int $notifications): void
    {
        $this->notifications = $notifications;
    }
731

732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
    /**
     * @return string
     */
    public function getSecurityTeamNotice(): string
    {
        return $this->securityTeamNotice;
    }

    /**
     * @param string $securityTeamNotice
     */
    public function setSecurityTeamNotice(string $securityTeamNotice)
    {
        $this->securityTeamNotice = $securityTeamNotice;
    }

748
749
750
751
752
753
754
755
756
    public function getMatrixOfSupportedTypo3Versions(): array
    {
        $supportedTypo3Versions = [];
        foreach ($this->versions as $version) {
            $version->getMatrixOfSupportedTypo3Versions($supportedTypo3Versions);
        }

        return $supportedTypo3Versions;
    }
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791

    /**
     * @return array
     */
    public function getLocalizationStatus(): array
    {
        if (!empty($this->localizationStatus)) {
            return json_decode($this->localizationStatus, true);
        }
        return [];
    }

    /**
     * @param string $localizationStatus
     */
    public function setLocalizationStatus(string $localizationStatus)
    {
        $this->localizationStatus = $localizationStatus;
    }

    /**
     * @return string
     */
    public function getCrowdinKey(): string
    {
        return $this->crowdinKey;
    }

    /**
     * @param string $crowdinKey
     */
    public function setCrowdinKey(string $crowdinKey)
    {
        $this->crowdinKey = $crowdinKey;
    }
792

793
    public function getAdditionalSupportVersions(): array
794
    {
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
        $supportedVersions = $this->getAllSupportedVersions();

        $supportVersionsOfLastVersion = $this->getLastVersion()->getMatrixOfSupportedTypo3Versions();
        foreach ($supportedVersions as $key => $version) {
            $test = $supportVersionsOfLastVersion[$key];
            if (!empty($test)) {
                unset($supportedVersions[$key]);
            }
        }

        return $supportedVersions;
    }

    public function getAllSupportedVersions(): array
    {
        $supportedVersions = [];
811
812

        $ltsVersionService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
813
814
        foreach ($ltsVersionService->getOldLTSVersions() as $versionNumber) {
            if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
815
                $supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = [
816
817
818
819
                    'label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS',
                    'badgeClass' => 'danger'
                ];
            }
820
821
822
        }
        foreach ($ltsVersionService->getELTSVersions() as $versionNumber) {
            if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
823
                $supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'warning'];
824
825
            }
        }
826
        foreach ($ltsVersionService->getActiveVersions() as $versionNumber) {
827
            if (VersionUtility::doesExtensionSupportTypo3Version($this, $versionNumber)) {
828
                $supportedVersions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = ['label' => $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS', 'badgeClass' => 'success'];
829
830
            }
        }
831
832
        if ($ltsVersionService->getLatestDevelopmentVersion(true) > VersionNumberUtility::convertVersionNumberToInteger($ltsVersionService->coreData['latest_lts'])
            && VersionUtility::doesExtensionSupportTypo3Version($this, $ltsVersionService->getLatestDevelopmentVersion(true))) {
833
            $supportedVersions[$ltsVersionService->getLatestDevelopmentVersion()] = ['label' => $ltsVersionService->getLatestDevelopmentVersion() . '-dev', 'badgeClass' => 'primary'];
834
        }
835
        array_unique($supportedVersions);
836

837
        return $supportedVersions;
838
    }
839

840
841
842
843
844
845
846
847
848
    /**
     * Actually an array is returned since the DTO object
     * does also implement JsonSerialize.
     *
     * @return array|ExtensionDto
     */
    public function jsonSerialize()
    {
        return new ExtensionDto($this);
849
    }
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865

    /**
     * @return int
     */
    public function getLastDownloadSync(): int
    {
        return $this->lastDownloadSync;
    }

    /**
     * @param int $lastDownloadSync
     */
    public function setLastDownloadSync(int $lastDownloadSync)
    {
        $this->lastDownloadSync = $lastDownloadSync;
    }
866
}