@@ 337-344 (lines=8) @@ | ||
334 | { |
|
335 | $locale = $locale ?: $this->getFallbackLocale(); |
|
336 | ||
337 | foreach ($this->translations as $translation) { |
|
338 | $translation->setRelation('parent', $this); |
|
339 | ||
340 | if ($translation->getAttribute($this->getLocaleKey()) == $locale) { |
|
341 | return true; |
|
342 | } |
|
343 | } |
|
344 | ||
345 | return false; |
|
346 | } |
|
347 | ||
@@ 578-585 (lines=8) @@ | ||
575 | ||
576 | private function getTranslationByLocaleKey($key) |
|
577 | { |
|
578 | foreach ($this->translations as $translation) { |
|
579 | $translation->setRelation('parent', $this); |
|
580 | ||
581 | if ($translation->getAttribute($this->getLocaleKey()) == $key) { |
|
582 | return $translation; |
|
583 | } |
|
584 | } |
|
585 | ||
586 | return null; |
|
587 | } |
|
588 |