you also need to check if the base class in symfony is there, in case somebody installs this with symfony 2.2 - see for example
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/FOSUserBundle.php#L42

i propose we also inverse the order, so that if we have the base class and the one in DoctrineBundle, we chose that, otherwise if we have the one in CoreBundle we chose that.

we do have to do all that as this code is executed regardless of whether orm (or phpcr-odm) is configured afterwards.