code: public function fromDbToEntity(array $data)
      {
          $hydratorFactory = $this->documentManager->getHydratorFactory();
          $documentClass = $this->documentClass;
  
          $document = new $documentClass();
          $hydratorFactory->hydrate($document, $data);
  
          return $document;
      }
docs: Take a embed document array representation to return entity
  
  @param array $data
  
  @return mixed