Returns an array with the data structured for translation.
\Drupal\tmgmt\JobItemInterface $job_item: The job item entity.
Overrides SourcePluginInterface::getData
JobItem::getData()
public function getData(JobItemInterface $job_item) {
// Allow tests to set custom source data.
$source = \Drupal::state()
->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.',
'#translate' => TRUE,
),
),
));
$variables = array(
'@type' => $job_item
->getItemType(),
'@id' => $job_item
->getItemId(),
);
$this
->replacePlaceholders($source, $variables);
return $source;
}