/**
  * Adds target groups, links and fields to document
  * @param $document_input
  * @param $document_id
  * @return mixed
  */
 private function addContentToDocument($target_groups, $links, $fields, $document_id)
 {
     $document = $this->getById($document_id);
     $document_target_group_db_mapper = new DocumentTargetGroupDBMapper();
     $document_link_db_mapper = new LinkDBMapper();
     $document_field_db_mapper = new DocumentFieldValueDBMapper();
     // Store current document id and timestamp
     $id = $document->getId();
     $timestamp = $document->getTimestamp();
     // Add all target groups, links and fields
     $document_target_group_db_mapper->addMultiple($target_groups, $id, $timestamp);
     $document_link_db_mapper->addMultiple($links, $id, $timestamp);
     $document_field_db_mapper->addMultiple($fields, $id, $timestamp);
     return $document_id;
 }