original_string: protected function _getLanguage($sourceSurveyId, $language)
      {
          if (! is_string($language)) {
              $language = (string) $language;
          }
  
          if (! isset($this->_languageMap[$sourceSurveyId][$language])) {
              if ($language && $this->_isLanguage($sourceSurveyId, $language)) {
                  $this->_languageMap[$sourceSurveyId][$language] = $language;
              } else {
                  $lsDb = $this->getSourceDatabase();
  
                  $sql = 'SELECT language
                      FROM ' . $this->_getSurveysTableName() . '
                      WHERE sid = ?';
  
                  $this->_languageMap[$sourceSurveyId][$language] = $lsDb->fetchOne($sql, $sourceSurveyId);
              }
          }
  
          return $this->_languageMap[$sourceSurveyId][$language];
      }
code: protected function _getLanguage($sourceSurveyId, $language)
      {
          if (! is_string($language)) {
              $language = (string) $language;
          }
  
          if (! isset($this->_languageMap[$sourceSurveyId][$language])) {
              if ($language && $this->_isLanguage($sourceSurveyId, $language)) {
                  $this->_languageMap[$sourceSurveyId][$language] = $language;
              } else {
                  $lsDb = $this->getSourceDatabase();
  
                  $sql = 'SELECT language
                      FROM ' . $this->_getSurveysTableName() . '
                      WHERE sid = ?';
  
                  $this->_languageMap[$sourceSurveyId][$language] = $lsDb->fetchOne($sql, $sourceSurveyId);
              }
          }
  
          return $this->_languageMap[$sourceSurveyId][$language];
      }
code_tokens: protected function _getLanguage ( $ sourceSurveyId , $ language ) { if ( ! is_string ( $ language ) ) { $ language = ( string ) $ language ; } if ( ! isset ( $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] ) ) { if ( $ language && $ this -> _isLanguage ( $ sourceSurveyId , $ language ) ) { $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] = $ language ; } else { $ lsDb = $ this -> getSourceDatabase ( ) ; $ sql = 'SELECT language
                      FROM ' . $ this -> _getSurveysTableName ( ) . '
                      WHERE sid = ?' ; $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] = $ lsDb -> fetchOne ( $ sql , $ sourceSurveyId ) ; } } return $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] ; }
docstring: Returns the langauge to use for the survey when this language is specified.
  
  Uses the requested language if it exists for the survey, the default language for the survey otherwise
  
  @param int $sourceSurveyId Survey ID
  @param string $language       (ISO) Language
  @return string (ISO) Language
docstring_tokens: Returns the langauge to use for the survey when this language is specified .