1 | <?php |
||
23 | trait TranslatableTrait |
||
24 | { |
||
25 | /** |
||
26 | * @var string[] |
||
27 | */ |
||
28 | private $locales; |
||
29 | |||
30 | /** |
||
31 | * @var string|null |
||
32 | */ |
||
33 | private $fallbackLocale; |
||
34 | |||
35 | /** |
||
36 | * @var FactoryInterface |
||
37 | */ |
||
38 | private $translationFactory; |
||
39 | |||
40 | /** |
||
41 | * @var TranslationInterface[]|Collection |
||
42 | */ |
||
43 | protected $translations; |
||
44 | |||
45 | /** |
||
46 | * @return string|null |
||
47 | */ |
||
48 | 3 | public function getLocale() |
|
55 | |||
56 | /** |
||
57 | * @return string[] |
||
58 | */ |
||
59 | 13 | public function getLocales() |
|
63 | |||
64 | /** |
||
65 | * @param string[] $locales |
||
66 | */ |
||
67 | 11 | public function setLocales($locales) |
|
71 | |||
72 | /** |
||
73 | * @return bool |
||
74 | */ |
||
75 | 7 | public function hasFallbackLocale() |
|
79 | |||
80 | /** |
||
81 | * @return string|null |
||
82 | */ |
||
83 | 7 | public function getFallbackLocale() |
|
87 | |||
88 | /** |
||
89 | * @param string|null $fallbackLocale |
||
90 | */ |
||
91 | 8 | public function setFallbackLocale($fallbackLocale) |
|
95 | |||
96 | /** |
||
97 | * @return FactoryInterface |
||
98 | */ |
||
99 | 6 | public function getTranslationFactory() |
|
103 | |||
104 | /** |
||
105 | * @param FactoryInterface $translationFactory |
||
106 | */ |
||
107 | 5 | public function setTranslationFactory(FactoryInterface $translationFactory) |
|
111 | |||
112 | /** |
||
113 | * @return TranslationInterface[]|Collection |
||
114 | */ |
||
115 | 5 | public function getTranslations() |
|
119 | |||
120 | /** |
||
121 | * @param bool $allowCreate |
||
122 | * |
||
123 | * @return TranslationInterface |
||
124 | */ |
||
125 | 10 | public function getTranslation($allowCreate = false) |
|
160 | |||
161 | /** |
||
162 | * @param TranslationInterface[]|Collection $translations |
||
163 | */ |
||
164 | public function setTranslations($translations) |
||
172 | |||
173 | /** |
||
174 | * @param TranslationInterface $translation |
||
175 | */ |
||
176 | 9 | public function addTranslation(TranslationInterface $translation) |
|
183 | |||
184 | /** |
||
185 | * @param TranslationInterface $translation |
||
186 | */ |
||
187 | 2 | public function removeTranslation(TranslationInterface $translation) |
|
193 | |||
194 | 19 | private function initTranslatable() |
|
198 | } |
||
199 |