@@ 380-387 (lines=8) @@ | ||
377 | { |
|
378 | $locale = $locale ?: $this->getFallbackLocale(); |
|
379 | ||
380 | foreach ($this->translations as $translation) { |
|
381 | $translation->setRelation('parent', $this); |
|
382 | ||
383 | if ($translation->getAttribute($this->getLocaleKey()) == $locale) { |
|
384 | return true; |
|
385 | } |
|
386 | } |
|
387 | ||
388 | return false; |
|
389 | } |
|
390 | ||
@@ 620-627 (lines=8) @@ | ||
617 | ||
618 | private function getTranslationByLocaleKey($key) |
|
619 | { |
|
620 | foreach ($this->translations as $translation) { |
|
621 | $translation->setRelation('parent', $this); |
|
622 | ||
623 | if ($translation->getAttribute($this->getLocaleKey()) == $key) { |
|
624 | return $translation; |
|
625 | } |
|
626 | } |
|
627 | ||
628 | return null; |
|
629 | } |
|
630 |