``getClassMetadata`` requires the fu name ..
Not sure if there is any point in change it to ``getClassMetadata(ClassUtils::getClass($data[$name]))->getName()`` or ``getClassMetadata(get_class$data[$name]))->getName()``. 
Especially because getClassMetadata uses ``ClassUtils`` behind the scene.