/** * Adds a job item to the xml export. * * @param $item * The job item entity. */ protected function addItem(JobItemInterface $item) { $this->startElement('group'); $this->writeAttribute('id', $item->id()); // Add a note for the source label. $this->writeElement('note', $item->getSourceLabel()); // @todo: Write in nested groups instead of flattening it. $data = \Drupal::service('tmgmt.data')->filterTranslatable($item->getData()); foreach ($data as $key => $element) { $this->addTransUnit($item->id() . '][' . $key, $element, $this->job); } $this->endElement(); }