Skip to content

Instantly share code, notes, and snippets.

@BenGriffiths
Created June 7, 2015 16:47
Show Gist options
  • Save BenGriffiths/2b1d66c1db427fc80757 to your computer and use it in GitHub Desktop.
Save BenGriffiths/2b1d66c1db427fc80757 to your computer and use it in GitHub Desktop.
public function getAllKeyValuesForLocale($localeShortCode = '')
{
$requestedLocale = $this->getLocale($localeShortCode);
$fallbackLocale = $this->getFallbackLocale();
$sql = QueryFetcher::fetch('MySQL/RepositoryLocaleConfiguration/getAllKeyValuesForLocale/default');
$statement = $this->executeQueryStd($sql, [
'fallbackLocaleId' => $fallbackLocale['id'],
'localeId' => $requestedLocale['id'],
]);
return $statement->fetchAll();
}
public function makeOtherLocalesNotFallback($exceptForLocaleId = 0, $locale = '')
{
$result = EntLocale::where('id', '!=', $exceptForLocaleId)->update(['is_fallback_default' => 0]);
$this->logAdminAction('Made locale "'.$locale.'" the default fallback', $exceptForLocaleId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment