123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?php
- /*
- * @file
- * Contains remote entity class.
- */
- /**
- * Entity class for the tmgmt_remote entity.
- *
- * @ingroup tmgmt_job
- */
- class TMGMTRemote extends Entity {
- /**
- * Primary key.
- *
- * @var int
- */
- public $trid;
- /**
- * TMGMTJob identifier.
- *
- * @var int
- */
- public $tjid;
- /**
- * TMGMTJobItem identifier.
- *
- * @var int
- */
- public $tjiid;
- /**
- * Translation job data item key.
- *
- * @var string
- */
- public $data_item_key;
- /**
- * Custom remote identifier 1.
- *
- * @var string
- */
- public $remote_identifier_1;
- /**
- * Custom remote identifier 2.
- *
- * @var string
- */
- public $remote_identifier_2;
- /**
- * Custom remote identifier 3.
- *
- * @var string
- */
- public $remote_identifier_3;
- /**
- * Remote job url.
- *
- * @var string
- */
- public $remote_url;
- /**
- * Word count provided by the remote service.
- *
- * @var int
- */
- public $word_count;
- /**
- * Amount charged for the remote translation job.
- *
- * @var int
- */
- public $amount;
- /**
- * Amount charged currency.
- *
- * @var string
- */
- public $currency;
- /**
- * Custom remote data.
- *
- * @var array
- */
- public $remote_data;
- /**
- * Gets translation job.
- *
- * @return TMGMTJob
- */
- function getJob() {
- return tmgmt_job_load($this->tjid);
- }
- /**
- * Gets translation job item.
- *
- * @return TMGMTJobItem
- */
- function getJobItem() {
- if (!empty($this->tjiid)) {
- return tmgmt_job_item_load($this->tjiid);
- }
- return NULL;
- }
- /**
- * Adds data to the remote_data storage.
- *
- * @param string $key
- * Key through which the data will be accessible.
- * @param $value
- * Value to store.
- */
- function addRemoteData($key, $value) {
- $this->remote_data[$key] = $value;
- }
- /**
- * Gets data from remote_data storage.
- *
- * @param string $key
- * Access key for the data.
- *
- * @return mixed
- * Stored data.
- */
- function getRemoteData($key) {
- return $this->remote_data[$key];
- }
- /**
- * Removes data from remote_data storage.
- *
- * @param string $key
- * Access key for the data that are to be removed.
- */
- function removeRemoteData($key) {
- unset($this->remote_data[$key]);
- }
- }
|