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