The check https://github.com/doctrine/persistence/blob/43526ae63312942e5316100bb3ed589ba1aba491/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php#L181 seems to be insufficient as a transient class may have an alias defined using `ResolveTargetEntityListener`.