Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| PublishedSectionTranslationDTO | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toArray | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace 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 | */ |
| 16 | class PublishedSectionTranslationDTO { |
| 17 | public function __construct( |
| 18 | private readonly int $sectionTranslationId, |
| 19 | private readonly string $sectionId, |
| 20 | private readonly string $startTimestamp, |
| 21 | private readonly string $lastUpdatedTimestamp, |
| 22 | private readonly string $sourceSectionTitle, |
| 23 | private readonly string $targetSectionTitle |
| 24 | ) { |
| 25 | } |
| 26 | |
| 27 | public function toArray(): array { |
| 28 | return [ |
| 29 | "sectionTranslationId" => $this->sectionTranslationId, |
| 30 | "sectionId" => $this->sectionId, |
| 31 | "startTimestamp" => $this->startTimestamp, |
| 32 | "lastUpdatedTimestamp" => $this->lastUpdatedTimestamp, |
| 33 | "sourceSectionTitle" => $this->sourceSectionTitle, |
| 34 | "targetSectionTitle" => $this->targetSectionTitle, |
| 35 | ]; |
| 36 | } |
| 37 | } |