Array of the data to be translated.
The structure is similar to the form API in the way that it is a possibly nested array with the following properties whose presence indicate that the current element is a text that might need to be translated.
@todo: Move data item documentation to a new, separate api group.
The key can be any alphanumeric character and '_'.
array $key: If present, only the subarray identified by key is returned.
int $index: Optional index of an attribute below $key.
array A structured data array.
Overrides JobItemInterface::getData
public function getData($key = array(), $index = NULL) {
$this
->decodeData();
if (empty($this->unserializedData) && $this
->getJobId()) {
// Load the data from the source if it has not been set yet.
$this->unserializedData = $this
->getSourceData();
$this
->save();
}
if (empty($key)) {
return $this->unserializedData;
}
if ($index) {
$key = array_merge($key, array(
$index,
));
}
return NestedArray::getValue($this->unserializedData, $key);
}