@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * Fire a model event. |
114 | 114 | * |
115 | - * @param $event |
|
115 | + * @param string $event |
|
116 | 116 | * @return mixed |
117 | 117 | */ |
118 | 118 | public function fireEvent($event) |
@@ -385,11 +385,17 @@ discard block |
||
385 | 385 | return get_class($this) . 'Translation'; |
386 | 386 | } |
387 | 387 | |
388 | + /** |
|
389 | + * @return string|null |
|
390 | + */ |
|
388 | 391 | public function getRelationKey() |
389 | 392 | { |
390 | 393 | return $this->translationForeignKey ?: $this->getForeignKey(); |
391 | 394 | } |
392 | 395 | |
396 | + /** |
|
397 | + * @return string |
|
398 | + */ |
|
393 | 399 | public function getLocaleKey() |
394 | 400 | { |
395 | 401 | return $this->localeKey ?: 'locale'; |
@@ -573,6 +579,9 @@ discard block |
||
573 | 579 | return parent::fill($attributes); |
574 | 580 | } |
575 | 581 | |
582 | + /** |
|
583 | + * @param string $key |
|
584 | + */ |
|
576 | 585 | private function getTranslationByLocaleKey($key) |
577 | 586 | { |
578 | 587 | foreach ($this->translations as $translation) { |
@@ -734,6 +743,9 @@ discard block |
||
734 | 743 | return class_exists($criteria) ? $criteria : EloquentCriteria::class; |
735 | 744 | } |
736 | 745 | |
746 | + /** |
|
747 | + * @param string $key |
|
748 | + */ |
|
737 | 749 | public function __get($key) |
738 | 750 | { |
739 | 751 | if ($this->hasHook($key)) { |