public function getDocumentPartial(DocumentManager $dm)
    {
        // Check identity map first, if its already in there just return it.
        $document = $dm->getUnitOfWork()->tryGetByIdentifier($this);
        if ($document !== false) {
            return $document;
        }

        $document = $this->class->newInstance();
        $this->addToDocument($document);
        $dm->getUnitOfWork()->registerManaged($document, $this, []);

        return $document;
    }