Moving to SQLSelect

This commit is contained in:
Daniel Hensby 2015-11-03 20:24:48 +00:00
parent e4bdf34d13
commit 0ffcd0c0ec

View File

@ -433,7 +433,7 @@ class Translatable extends DataExtension implements PermissionProvider {
$translationGroupID = $this->getTranslationGroup(); $translationGroupID = $this->getTranslationGroup();
if(is_numeric($translationGroupID)) { if(is_numeric($translationGroupID)) {
$query = new SQLQuery( $query = new SQLSelect(
'DISTINCT "Locale"', 'DISTINCT "Locale"',
sprintf( sprintf(
'"%s" LEFT JOIN "%s" ON "%s"."OriginalID" = "%s"."ID"', '"%s" LEFT JOIN "%s" ON "%s"."OriginalID" = "%s"."ID"',
@ -583,9 +583,9 @@ class Translatable extends DataExtension implements PermissionProvider {
} }
/** /**
* Check if a given SQLQuery filters on the Locale field * Check if a given SQLSelect filters on the Locale field
* *
* @param SQLQuery $query * @param SQLSelect $query
* @return boolean * @return boolean
*/ */
protected function filtersOnLocale($query) { protected function filtersOnLocale($query) {
@ -1634,7 +1634,7 @@ class Translatable extends DataExtension implements PermissionProvider {
*/ */
static function get_existing_content_languages($className = 'SiteTree', $where = '') { static function get_existing_content_languages($className = 'SiteTree', $where = '') {
$baseTable = ClassInfo::baseDataClass($className); $baseTable = ClassInfo::baseDataClass($className);
$query = new SQLQuery("Distinct \"Locale\"","\"$baseTable\"",$where, '', "\"Locale\""); $query = new SQLSelect("Distinct \"Locale\"","\"$baseTable\"",$where, '', "\"Locale\"");
$dbLangs = $query->execute()->column(); $dbLangs = $query->execute()->column();
$langlist = array_merge((array)Translatable::default_locale(), (array)$dbLangs); $langlist = array_merge((array)Translatable::default_locale(), (array)$dbLangs);
$returnMap = array(); $returnMap = array();