@@ -34,6 +34,9 @@ discard block |
||
34 | 34 | }); |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param string $locale |
|
39 | + */ |
|
37 | 40 | public function translate(?string $locale = null, bool $withFallback = false): ?Model |
38 | 41 | { |
39 | 42 | return $this->getTranslation($locale, $withFallback); |
@@ -155,6 +158,9 @@ discard block |
||
155 | 158 | return empty($value); |
156 | 159 | } |
157 | 160 | |
161 | + /** |
|
162 | + * @param string $key |
|
163 | + */ |
|
158 | 164 | public function getAttribute($key) |
159 | 165 | { |
160 | 166 | [$attribute, $locale] = $this->getAttributeAndLocale($key); |
@@ -179,6 +185,10 @@ discard block |
||
179 | 185 | return parent::getAttribute($key); |
180 | 186 | } |
181 | 187 | |
188 | + /** |
|
189 | + * @param string $key |
|
190 | + * @param string $value |
|
191 | + */ |
|
182 | 192 | public function setAttribute($key, $value) |
183 | 193 | { |
184 | 194 | [$attribute, $locale] = $this->getAttributeAndLocale($key); |
@@ -514,6 +524,9 @@ discard block |
||
514 | 524 | return $this->getLocalesHelper()->current(); |
515 | 525 | } |
516 | 526 | |
527 | + /** |
|
528 | + * @param string|null $locale |
|
529 | + */ |
|
517 | 530 | public function setDefaultLocale(?string $locale) |
518 | 531 | { |
519 | 532 | $this->defaultLocale = $locale; |