code: public function getManagerForClass($class)
      {
          $reflectionClass = new \ReflectionClass($class);
          if ($reflectionClass->implementsInterface(Proxy::class)) {
              $class = $reflectionClass->getParentClass()->name;
          }
  
          foreach ($this->getManagerNames() as $name) {
              $manager = $this->getManager($name);
              if (!$manager->getMetadataFactory()->isTransient($class)) {
                  return $manager;
              }
          }
      }
docs: @param string $class
  
  @return EntityManager|ObjectManager|null