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 | 3 | */ |
|
48 | public function getLocale() |
||
55 | |||
56 | /** |
||
57 | * @return string[] |
||
58 | 13 | */ |
|
59 | public function getLocales() |
||
63 | |||
64 | /** |
||
65 | * @param string[] $locales |
||
66 | 11 | */ |
|
67 | public function setLocales($locales) |
||
71 | |||
72 | /** |
||
73 | * @return bool |
||
74 | 7 | */ |
|
75 | public function hasFallbackLocale() |
||
79 | |||
80 | /** |
||
81 | * @return string|null |
||
82 | 7 | */ |
|
83 | public function getFallbackLocale() |
||
87 | |||
88 | /** |
||
89 | * @param string|null $fallbackLocale |
||
90 | 8 | */ |
|
91 | public function setFallbackLocale($fallbackLocale) |
||
95 | |||
96 | /** |
||
97 | * @return FactoryInterface |
||
98 | 6 | */ |
|
99 | public function getTranslationFactory() |
||
103 | |||
104 | /** |
||
105 | * @param FactoryInterface $translationFactory |
||
106 | 5 | */ |
|
107 | public function setTranslationFactory(FactoryInterface $translationFactory) |
||
111 | |||
112 | /** |
||
113 | * @return TranslationInterface[]|Collection |
||
114 | 6 | */ |
|
115 | public function getTranslations() |
||
119 | |||
120 | /** |
||
121 | * @param bool $allowCreate |
||
122 | * |
||
123 | * @return TranslationInterface |
||
124 | 10 | */ |
|
125 | public function getTranslation($allowCreate = false) |
||
160 | |||
161 | 5 | /** |
|
162 | * @param TranslationInterface[]|Collection $translations |
||
163 | */ |
||
164 | public function setTranslations($translations) |
||
172 | 9 | ||
173 | 9 | /** |
|
174 | * @param TranslationInterface $translation |
||
175 | */ |
||
176 | public function addTranslation(TranslationInterface $translation) |
||
183 | 2 | ||
184 | /** |
||
185 | 19 | * @param TranslationInterface $translation |
|
186 | */ |
||
187 | 19 | public function removeTranslation(TranslationInterface $translation) |
|
193 | |||
194 | private function initTranslatable() |
||
198 | } |
||
199 |