Skip to content

Commit

Permalink
feat: added getOneActiveByLanguageCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamek authored Oct 6, 2020
1 parent 64c868f commit ebeea6f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Dravencms/Model/Locale/Repository/LocaleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ public function getOneByLanguageCode($languageCode)
{
return $this->localeRepository->findOneBy(['languageCode' => $languageCode]);
}

/**
* @param $languageCode string
* @return mixed|null|Locale
*/
public function getOneActiveByLanguageCode($languageCode)
{
return $this->localeRepository->findOneBy(['languageCode' => $languageCode, 'isActive' => true]);
}

/**
* @return array
Expand Down Expand Up @@ -173,4 +182,4 @@ public function getLocaleCache($languageCode)
return $found;
}
}
}
}

0 comments on commit ebeea6f

Please sign in to comment.