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);
    }