1 | <?php |
||
19 | trait TranslatableTrait |
||
20 | { |
||
21 | /** |
||
22 | * @var TranslationInterface[] |
||
23 | */ |
||
24 | protected $translations; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $currentLocale; |
||
30 | |||
31 | /** |
||
32 | * Cache current translation. Useful in Doctrine 2.4+ |
||
33 | * |
||
34 | * @var TranslationInterface |
||
35 | */ |
||
36 | protected $currentTranslation; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $fallbackLocale; |
||
42 | |||
43 | public function __construct() |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function getTranslations() |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function addTranslation(TranslationInterface $translation) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function removeTranslation(TranslationInterface $translation) |
||
76 | |||
77 | /** |
||
78 | * @param TranslationInterface $translation |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function hasTranslation(TranslationInterface $translation) |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public function setCurrentLocale($currentLocale) |
||
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getCurrentLocale() |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function setFallbackLocale($fallbackLocale) |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getFallbackLocale() |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function translate($locale = null) |
||
155 | |||
156 | /** |
||
157 | * Return translation model class. |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | public static function getTranslationClass() |
||
165 | } |
||
166 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..