Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
AbstractTranslationDTO
0.00% covered (danger)
0.00%
0 / 9
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 / 8
0.00% covered (danger)
0.00%
0 / 1
2
 getLastUpdatedTimestamp
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
n/a
0 / 0
n/a
0 / 0
0
1<?php
2
3declare( strict_types = 1 );
4
5namespace ContentTranslation\DTO;
6
7/**
8 * This class is a base class that encapsulates all the basic
9 * properties used inside (draft or published) translation DTO
10 * classes.
11 *
12 * @copyright See AUTHORS.txt
13 * @license GPL-2.0-or-later
14 */
15abstract class AbstractTranslationDTO {
16    protected int $translationId;
17    protected string $sourceTitle;
18    protected string $sourceLanguage;
19    protected string $targetLanguage;
20    protected string $startTimestamp;
21    protected string $lastUpdatedTimestamp;
22    protected string $pageRevision;
23    protected ?string $targetTitle;
24
25    public function __construct(
26        int $translationId,
27        string $sourceTitle,
28        string $sourceLanguage,
29        string $targetLanguage,
30        string $startTimestamp,
31        string $lastUpdatedTimestamp,
32        string $pageRevision,
33        ?string $targetTitle
34    ) {
35        $this->translationId = $translationId;
36        $this->sourceTitle = $sourceTitle;
37        $this->sourceLanguage = $sourceLanguage;
38        $this->targetLanguage = $targetLanguage;
39        $this->startTimestamp = $startTimestamp;
40        $this->lastUpdatedTimestamp = $lastUpdatedTimestamp;
41        $this->pageRevision = $pageRevision;
42        $this->targetTitle = $targetTitle;
43    }
44
45    public function getLastUpdatedTimestamp(): string {
46        return $this->lastUpdatedTimestamp;
47    }
48
49    abstract public function toArray(): array;
50}