/**
 * Synchronises the job with Translation Proxy and increments the completed
 * job count in case of having downloaded a job.
 
 *
 *@param WPML_TP_Polling_Counts $counts count object to be updated
 */
 protected function sync_action(&$counts)
 {
     if ((bool) $this->data['cms_id'] === true) {
         $this->cms_id_helper->get_translation_id($this->data['cms_id'], $this->project->service());
     }
     $this->data['job_state'] = $this->data['job_state'] === 'delivered' ? 'translation_ready' : $this->data['job_state'];
     if ($this->data['job_state'] === 'translation_ready' && $this->pro_translation->poll_updated_job_status_with_log(array($this->data['id'], $this->data['cms_id'], 'translation_ready'), true) === 1) {
         $counts->complete_job();
     }
 }
 /**
  * Synchronises the job with Translation Proxy and increments the cancelled
  * job count in case of having cancelled a job.
  *
  * @param WPML_TP_Polling_Counts $counts count object to be updated
  */
 protected function sync_action(&$counts)
 {
     if ($this->pro_translation->poll_updated_job_status_with_log(array($this->data['id'], $this->data['cms_id'], 'cancelled'), true)) {
         $counts->cancel_job();
     }
 }