Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
PublishedSectionTranslationDTO
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types = 1 );
4
5namespace ContentTranslation\DTO;
6
7/**
8 * This class encapsulates published section translation data transfer
9 * objects, that are used inside the "$sectionTranslations" property
10 * of PublishedTranslationDTO class to represent all the published section
11 * translations for a specific published translation.
12 *
13 * @copyright See AUTHORS.txt
14 * @license GPL-2.0-or-later
15 */
16class PublishedSectionTranslationDTO {
17    private int $sectionTranslationId;
18    private string $sectionId;
19    private string $startTimestamp;
20    private string $lastUpdatedTimestamp;
21    private string $sourceSectionTitle;
22    private string $targetSectionTitle;
23
24    public function __construct(
25        int $sectionTranslationId,
26        string $sectionId,
27        string $startTimestamp,
28        string $lastUpdatedTimestamp,
29        string $sourceSectionTitle,
30        string $targetSectionTitle
31    ) {
32        $this->sectionTranslationId = $sectionTranslationId;
33        $this->sectionId = $sectionId;
34        $this->startTimestamp = $startTimestamp;
35        $this->lastUpdatedTimestamp = $lastUpdatedTimestamp;
36        $this->sourceSectionTitle = $sourceSectionTitle;
37        $this->targetSectionTitle = $targetSectionTitle;
38    }
39
40    public function toArray(): array {
41        return [
42            "sectionTranslationId" => $this->sectionTranslationId,
43            "sectionId" => $this->sectionId,
44            "startTimestamp" => $this->startTimestamp,
45            "lastUpdatedTimestamp" => $this->lastUpdatedTimestamp,
46            "sourceSectionTitle" => $this->sourceSectionTitle,
47            "targetSectionTitle" => $this->targetSectionTitle,
48        ];
49    }
50}