$myObject = $em->find(ContactRelation::class, $userId); echo get_class($myObject); // SomeNameSpaceDomainIdentityContactRelation