Implements TMGMTFileExportInterface::export().
Overrides FormatInterface::export
public function export(JobInterface $job, $conditions = array()) {
$items = array();
foreach ($job
->getItems($conditions) as $item) {
$data = \Drupal::service('tmgmt.data')
->filterTranslatable($item
->getData());
foreach ($data as $key => $value) {
$items[$item
->id()][$this
->encodeIdSafeBase64($item
->id() . '][' . $key)] = $value;
}
}
$elements = array(
'#theme' => 'tmgmt_file_html_template',
'#tjid' => $job
->id(),
'#source_language' => $job
->getRemoteSourceLanguage(),
'#target_language' => $job
->getRemoteTargetLanguage(),
'#items' => $items,
);
return \Drupal::service('renderer')
->renderPlain($elements);
}