1 | <?php |
||
21 | trait TranslatableTrait |
||
22 | { |
||
23 | /** |
||
24 | * @var TranslationInterface[] |
||
25 | */ |
||
26 | protected $translations; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $currentLocale; |
||
32 | |||
33 | /** |
||
34 | * Cache current translation. Useful in Doctrine 2.4+ |
||
35 | * |
||
36 | * @var TranslationInterface |
||
37 | */ |
||
38 | protected $currentTranslation; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $fallbackLocale; |
||
44 | |||
45 | public function __construct() |
||
49 | |||
50 | /** |
||
51 | * @param string $locale |
||
52 | * |
||
53 | * @return TranslationInterface |
||
54 | */ |
||
55 | public function getTranslation($locale = null) |
||
79 | |||
80 | /** |
||
81 | * @return TranslationInterface[] |
||
82 | */ |
||
83 | public function getTranslations() |
||
87 | |||
88 | /** |
||
89 | * @param TranslationInterface $translation |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function hasTranslation(TranslationInterface $translation) |
||
97 | |||
98 | /** |
||
99 | * @param TranslationInterface $translation |
||
100 | */ |
||
101 | public function addTranslation(TranslationInterface $translation) |
||
108 | |||
109 | /** |
||
110 | * @param TranslationInterface $translation |
||
111 | */ |
||
112 | public function removeTranslation(TranslationInterface $translation) |
||
118 | |||
119 | /** |
||
120 | * @param string $currentLocale |
||
121 | */ |
||
122 | public function setCurrentLocale($currentLocale) |
||
126 | |||
127 | /** |
||
128 | * @param string $fallbackLocale |
||
129 | */ |
||
130 | public function setFallbackLocale($fallbackLocale) |
||
134 | |||
135 | /** |
||
136 | * @return TranslationInterface |
||
137 | */ |
||
138 | abstract protected function createTranslation(); |
||
139 | } |
||
140 |
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..