code: public function fromEntityToDb($document)
      {
          $unitOfWork = $this->documentManager->getUnitOfWork();
          $persistenceBuilder = new PersistenceBuilder($this->documentManager, $unitOfWork);
          $mapping = array (
              'targetDocument' => $this->documentClass,
          );
  
          return $persistenceBuilder->prepareEmbeddedDocumentValue($mapping, $document, true);
      }
docs: Take a id to turn it into a embed document array representation
  
  @param mixed $document
  
  @return array