@@ 339-346 (lines=8) @@ | ||
336 | { |
|
337 | $locale = $locale ?: $this->getFallbackLocale(); |
|
338 | ||
339 | foreach ($this->translations as $translation) { |
|
340 | ||
341 | $translation->setRelation('parent', $this); |
|
342 | ||
343 | if ($translation->getAttribute($this->getLocaleKey()) == $locale) { |
|
344 | return true; |
|
345 | } |
|
346 | } |
|
347 | ||
348 | return false; |
|
349 | } |
|
@@ 569-576 (lines=8) @@ | ||
566 | ||
567 | private function getTranslationByLocaleKey($key) |
|
568 | { |
|
569 | foreach ($this->translations as $translation) { |
|
570 | ||
571 | $translation->setRelation('parent', $this); |
|
572 | ||
573 | if ($translation->getAttribute($this->getLocaleKey()) == $key) { |
|
574 | return $translation; |
|
575 | } |
|
576 | } |
|
577 | ||
578 | return null; |
|
579 | } |