1 | <?php |
||
9 | class Translation |
||
10 | { |
||
11 | protected $id; |
||
12 | protected $context; |
||
13 | protected $original; |
||
14 | protected $translation; |
||
15 | protected $plural; |
||
16 | protected $pluralTranslations = []; |
||
17 | protected $disabled = false; |
||
18 | protected $references; |
||
19 | protected $flags; |
||
20 | protected $comments; |
||
21 | protected $extractedComments; |
||
22 | |||
23 | public static function create(?string $context, string $original): Translation |
||
33 | |||
34 | protected static function generateId(?string $context, string $original): string |
||
38 | |||
39 | protected function __construct(string $id) |
||
48 | |||
49 | public function __clone() |
||
56 | |||
57 | public function getId(): string |
||
61 | |||
62 | public function getContext(): ?string |
||
66 | |||
67 | public function withContext(?string $context): Translation |
||
75 | |||
76 | public function getOriginal(): ?string |
||
80 | |||
81 | public function withOriginal(string $original): Translation |
||
89 | |||
90 | public function setPlural(string $plural): self |
||
96 | |||
97 | public function getPlural(): ?string |
||
101 | |||
102 | public function disable(bool $disabled = true): self |
||
108 | |||
109 | public function isDisabled(): bool |
||
113 | |||
114 | public function translate(string $translation): self |
||
120 | |||
121 | public function getTranslation(): ?string |
||
125 | |||
126 | public function isTranslated(): bool |
||
130 | |||
131 | public function translatePlural(string ...$translations): self |
||
137 | |||
138 | public function getPluralTranslations(): array |
||
142 | |||
143 | public function getReferences(): References |
||
147 | |||
148 | public function getFlags(): Flags |
||
152 | |||
153 | public function getComments(): Comments |
||
157 | |||
158 | public function getExtractedComments(): Comments |
||
162 | } |
||
163 |