You are here

public function TMGMTTestSourcePluginController::getData in Translation Management Tool 7

Returns an array with the data structured for translation.

Parameters

TMGMTJobItem $job_item: The job item entity.

Overrides TMGMTSourcePluginControllerInterface::getData

See also

TMGMTJobItem::getData()

1 method overrides TMGMTTestSourcePluginController::getData()
TMGMTTestHTMLSourcePluginController::getData in tests/tmgmt_test.plugin.html_source.inc
Returns an array with the data structured for translation.

File

tests/tmgmt_test.plugin.source.inc, line 44
Contains the test source plugin.

Class

TMGMTTestSourcePluginController
@file Contains the test source plugin.

Code

public function getData(TMGMTJobItem $job_item) {

  // Allow tests to set custom source data.
  $source = variable_get('tmgmt_test_source_data', array(
    'dummy' => array(
      'deep_nesting' => array(
        '#text' => 'Text for job item with type @type and id @id.',
        '#label' => 'Label for job item with type @type and id @id.',
      ),
    ),
  ));
  $variables = array(
    '@type' => $job_item->item_type,
    '@id' => $job_item->item_id,
  );
  $this
    ->replacePlaceholders($source, $variables);
  return $source;
}