You are here

protected function TMGMTTranslatorController::buildQuery in Translation Management Tool 7

Support loading by name key.

Overrides EntityAPIControllerExportable::buildQuery

File

controller/tmgmt.controller.translator.inc, line 18
Contains the translator controller class.

Class

TMGMTTranslatorController
Controller class for the job entity.

Code

protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
  $query = parent::buildQuery($ids, $conditions, $revision_id);
  if ($plugins = tmgmt_translator_plugin_info()) {
    $query
      ->condition('plugin', array_keys($plugins));
  }
  else {

    // Don't return any translators if no plugin exists.
    $query
      ->where('1 = 0');
  }

  // Sort by the weight of the translator.
  $query
    ->orderBy('weight');
  return $query;
}