Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 18
0.00% covered (danger)
0.00%
0 / 12
CRAP
0.00% covered (danger)
0.00%
0 / 1
SectionTranslation
0.00% covered (danger)
0.00%
0 / 18
0.00% covered (danger)
0.00%
0 / 12
156
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 getId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSectionId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTranslationId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSourceSectionTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTargetSectionTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTargetSectionTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTranslationStatus
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTranslationStatus
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getProgress
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setProgress
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types = 1 );
4
5namespace ContentTranslation\Entity;
6
7/**
8 * Model for "cx_section_translations" table (defined in section-translations.sql file)
9 */
10class SectionTranslation {
11    protected ?int $id;
12    protected int $translationId;
13    protected string $sectionId;
14    protected string $sourceSectionTitle;
15    protected string $targetSectionTitle;
16    /**
17     * The status of the translation. 0 for "draft", 1 for "published", 2 for "deleted"
18     * @var int|null
19     */
20    protected ?int $translationStatus;
21    private string $progress;
22
23    public function __construct(
24        ?int $id,
25        int $translationId,
26        string $sectionId,
27        string $sourceSectionTitle,
28        string $targetSectionTitle,
29        // letting this to be null for backward compatibility, since the field was
30        // just recently added to the "cx_section_translations" table
31        ?int $translationStatus,
32        string $progress
33    ) {
34        $this->id = $id;
35        $this->translationId = $translationId;
36        $this->sectionId = $sectionId;
37        $this->sourceSectionTitle = $sourceSectionTitle;
38        $this->targetSectionTitle = $targetSectionTitle;
39        $this->translationStatus = $translationStatus;
40        $this->progress = $progress;
41    }
42
43    public function getId(): ?int {
44        return $this->id;
45    }
46
47    public function setId( ?int $id ): void {
48        $this->id = $id;
49    }
50
51    public function getSectionId(): string {
52        return $this->sectionId;
53    }
54
55    public function getTranslationId(): int {
56        return $this->translationId;
57    }
58
59    public function getSourceSectionTitle(): string {
60        return $this->sourceSectionTitle;
61    }
62
63    public function getTargetSectionTitle(): string {
64        return $this->targetSectionTitle;
65    }
66
67    public function setTargetSectionTitle( string $targetSectionTitle ): void {
68        $this->targetSectionTitle = $targetSectionTitle;
69    }
70
71    public function setTranslationStatus( ?int $translationStatus ): void {
72        $this->translationStatus = $translationStatus;
73    }
74
75    public function getTranslationStatus(): ?int {
76        return $this->translationStatus;
77    }
78
79    public function getProgress(): string {
80        return $this->progress;
81    }
82
83    public function setProgress( string $progress ): void {
84        $this->progress = $progress;
85    }
86}