/** * WPML_TM_ICL_Translation_Status constructor. * * @param WPML_TM_Records $tm_records * @param int $job_id */ public function __construct(&$tm_records, $job_id) { parent::__construct($tm_records); $job_id = (int) $job_id; if ($job_id > 0) { $this->job_id = $job_id; } else { throw new InvalidArgumentException('Invalid Job ID: ' . $job_id); } }
/** * WPML_TM_ICL_Translations constructor. * * @throws InvalidArgumentException if given data does not correspond to a * record in icl_translations * * @param WPML_TM_Records $tm_records * @param int|array $id * @param string $type translation id, trid_lang or id_prefix for now */ public function __construct(&$tm_records, $id, $type = 'translation_id') { $this->wpdb = $tm_records->wpdb(); parent::__construct($tm_records); if ($id > 0 && $type === 'translation_id') { $this->{$type} = $id; } elseif ($type === 'id_type_prefix' && isset($id['element_id']) && isset($id['type_prefix'])) { $this->select_translation_id(" element_id = %d AND element_type LIKE %s ", array($id['element_id'], $id['type_prefix'] . '%')); } elseif ($type === 'trid_lang' && isset($id['trid']) && isset($id['language_code'])) { $this->select_translation_id(" trid = %d AND language_code = %s ", array($id['trid'], $id['language_code'])); } else { throw new InvalidArgumentException('Unknown column: ' . $type . ' or invalid id: ' . serialize($id)); } }
/** * WPML_TM_ICL_Translations constructor. * * @throws InvalidArgumentException if given data does not correspond to a * record in icl_translations * * @param WPML_TM_Records $tm_records * @param int|array $id * @param string $type translation id, trid_lang or id_prefix for now */ public function __construct(&$tm_records, $id, $type = 'translation_id') { $this->wpdb = $tm_records->wpdb(); $this->post_translations = $tm_records->get_post_translations(); $this->term_translations = $tm_records->get_term_translations(); parent::__construct($tm_records); if ($id > 0 && $type === 'translation_id') { $this->{$type} = $id; } elseif ($type === 'id_type_prefix' && isset($id['element_id']) && isset($id['type_prefix'])) { $this->build_from_element_id($id); } elseif ($type === 'trid_lang' && isset($id['trid']) && isset($id['language_code'])) { $this->build_from_trid($id); } else { throw new InvalidArgumentException('Unknown column: ' . $type . ' or invalid id: ' . serialize($id)); } }
/** * WPML_TM_CMS_ID constructor. * * @param WPML_TM_Records $tm_records * @param WPML_Translation_Job_Factory $job_factory */ public function __construct(&$tm_records, &$job_factory) { parent::__construct($tm_records); $this->job_factory =& $job_factory; $this->wpdb = $this->tm_records->wpdb(); }
public function __construct(WPML_TM_Records $tm_records) { parent::__construct($tm_records); $this->wpml_cache = new WPML_WP_Cache('element_translations'); }
public function __construct(&$tm_records, &$tm_status, &$post_translations) { parent::__construct($tm_records); $this->tm_status =& $tm_status; $this->post_translations =& $post_translations; }