class PDTarget in GlobalLink Connect for Drupal 7.7
Hierarchy
- class \PDTarget
Expanded class hierarchy of PDTarget
File
- gl_ws/
glc/ model/ Target.inc.php, line 3
View source
class PDTarget {
/**
* Unique document identifier.
*/
public $clientIdentifier;
/**
* Name of the document
*/
public $documentName;
/**
* Document ticket
*/
public $documentTicket;
/**
* Target's source locale
*/
public $sourceLocale;
/**
* Target's target locale
*/
public $targetLocale;
/**
* Array of target metadata
*/
public $metadata;
/**
* Target ticket
*/
public $ticket;
/**
* PDWordCount of target
*/
public $wordCount;
function __construct($externalTarget) {
$this->documentName = $externalTarget->document->documentInfo->name;
$this->sourceLocale = $externalTarget->sourceLanguage->locale;
$this->targetLocale = $externalTarget->targetLanguage->locale;
$this->ticket = $externalTarget->ticket;
$this->documentTicket = $externalTarget->document->ticket;
$this->wordCount = $externalTarget->document->documentInfo->wordCount;
$this->clientIdentifier = $externalTarget->document->documentInfo->clientIdentifier;
if (isset($externalTarget->tmStatistics)) {
$this->wordCount = new WordCount($externalTarget->tmStatistics->inContextMatchWordCount, $externalTarget->tmStatistics->oneHundredMatchWordCount, $externalTarget->tmStatistics->repetitionWordCount, $externalTarget->tmStatistics->noMatchWordCount, $externalTarget->tmStatistics->totalWordCount);
}
if (isset($externalTarget->targetInfo->metadata) && is_array($externalTarget->targetInfo->metadata)) {
foreach ($externalTarget->targetInfo->metadata as $k => $v) {
$this->metadata[$k] = $v;
}
}
if (isset($externalTarget->document->documentInfo->metadata)) {
$this->metadata = array();
$metadatas = is_array($externalTarget->document->documentInfo->metadata) ? $externalTarget->document->documentInfo->metadata : array(
$externalTarget->document->documentInfo->metadata,
);
foreach ($metadatas as $meta) {
$this->metadata[$meta->key] = $meta->value;
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PDTarget:: |
public | property | Unique document identifier. | |
PDTarget:: |
public | property | Name of the document | |
PDTarget:: |
public | property | Document ticket | |
PDTarget:: |
public | property | Array of target metadata | |
PDTarget:: |
public | property | Target's source locale | |
PDTarget:: |
public | property | Target's target locale | |
PDTarget:: |
public | property | Target ticket | |
PDTarget:: |
public | property | PDWordCount of target | |
PDTarget:: |
function |