Implements TMGMTEntitySourcePluginController::getData().
Returns the data from the fields as a structure that can be processed by the Translation Management system.
Overrides SourcePluginInterface::getData
public function getData(JobItemInterface $job_item) {
$config_mapper = $this
->getMapper($job_item);
$data = array();
foreach ($config_mapper
->getConfigData() as $config_id => $config_data) {
$schema = $this->typedConfig
->get($config_id);
$processor = $this
->getConfigProcessor($schema);
$processor
->setConfigMapper($config_mapper);
$config_id = str_replace('.', '__', $config_id);
$data[$config_id] = $processor
->extractTranslatables($schema, $config_data);
}
// If there is only one, we simplify the data and return it.
if (count($data) == 1) {
return reset($data);
}
else {
return $data;
}
}