/**
  * @param WPML_Translation_Job $job
  */
 public function add_job($job)
 {
     $batch_id = $job->get_batch_id();
     $batch = array_key_exists($batch_id, $this->translation_batches) ? $this->translation_batches[$batch_id] : new WPML_Translation_Batch($this->wpdb, $batch_id);
     $batch->add_job($job);
     $this->translation_batches[$batch->get_id()] = $batch;
 }
 /**
  * @param int                               $job_id
  * @param null|int                          $batch_id
  * @param null|TranslationManagement        $tm_instance
  * @param null|WPML_Translation_Job_Factory $job_factory
  */
 function __construct($job_id, $batch_id = null, &$tm_instance = null, &$job_factory = null)
 {
     parent::__construct($job_id, $batch_id, $tm_instance);
     $this->original_del_text = __("The original has been deleted!", "sitepress");
     if (!$job_factory) {
         global $wpml_translation_job_factory;
         $job_factory =& $wpml_translation_job_factory;
     }
     $this->job_factory = $job_factory;
 }
 /**
  * @param WPML_Translation_Job $job
  * @param string               $user_language
  *
  * @return array
  */
 private function get_lang_to_from($job, $user_language)
 {
     $sql = "SELECT name FROM {$this->wpdb->prefix}icl_languages_translations WHERE language_code=%s AND display_language_code=%s LIMIT 1";
     $lang_from = $this->wpdb->get_var($this->wpdb->prepare($sql, $job->get_source_language_code(), $user_language));
     $lang_to = $this->wpdb->get_var($this->wpdb->prepare($sql, $job->get_language_code(), $user_language));
     return array($lang_from, $lang_to);
 }
 /**
  * @return string
  */
 public function get_id()
 {
     return 'string|' . parent::get_id();
 }
 /**
  * @param WPML_Translation_Job $job
  */
 public function add_job($job)
 {
     $this->job_objects[$job->get_id()] = $job;
 }