<?php if (!defined('ABSPATH'))
	exit; ?>
<?php

class polylai_Translation extends polylai_Data
{
	var $title;
	var $date;
	var $status;
	var $id;

	public function __construct($post)
	{
		$this->id = $post->ID;
		$this->title = $post->post_title;
		$this->date = $post->post_date;
		$this->status = $post->post_status;

		$data = json_decode($post->post_content);

		$this->service = $data->service;
		$this->lang_from = $data->lang_from;
		$this->lang_to = $data->lang_to;
		$this->locale_to = $data->locale_to;
		$this->final_post_status = $data->final_post_status;
		$this->source_post_id = $data->source_post_id;
		$this->cloud_guid = $data->cloud_guid;
		$this->error_code = $data->error_code;
		$this->request_id = isset($data->request_id) ? $data->request_id : null;
		$this->used_tokens = $data->used_tokens;
		$this->fields = $data->fields;
	}
}