private static function isValidManager(ObjectManager $manager, $class)
    {
        $meta = $manager->getClassMetadata($class);

        return !$meta instanceof OrmClassMetadata || !$meta->isMappedSuperclass;
    }