You are here

public function TMGMTLocalTaskItem::getData in Translation Management Tool 7

Array of translations.

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.

  • #text: The translated text of the corresponding entry in the job item.
  • #status: The status of the translation.

The key can be an alphanumeric string.

Parameters

array $key: If present, only the subarray identified by key is returned.

string $index: Optional index of an attribute below $key.

Return value

array A structured data array.

File

translators/tmgmt_local/entity/tmgmt_local.entity.task_item.inc, line 212

Class

TMGMTLocalTaskItem
Entity class for the local task item entity.

Code

public function getData(array $key = array(), $index = NULL) {
  if (empty($key)) {
    return $this->data;
  }
  if ($index) {
    $key = array_merge($key, array(
      $index,
    ));
  }
  return drupal_array_get_nested_value($this->data, $key);
}