Yeah, I think `return !UnitOfWork::STATE_NEW === $uow->getDocumentState($document)` is what is needed here.`