original_string: public static function getManager(ManagerRegistry $or, $class)
      {
          $manager = $or->getManagerForClass($class);
  
          if (null === $manager) {
              foreach ($or->getManagers() as $objectManager) {
                  if ($objectManager->getMetadataFactory()->hasMetadataFor($class)
                          && self::isValidManager($objectManager, $class)) {
                      $manager = $objectManager;
  
                      break;
                  }
              }
          }
  
          return $manager;
      }
code: public static function getManager(ManagerRegistry $or, $class)
      {
          $manager = $or->getManagerForClass($class);
  
          if (null === $manager) {
              foreach ($or->getManagers() as $objectManager) {
                  if ($objectManager->getMetadataFactory()->hasMetadataFor($class)
                          && self::isValidManager($objectManager, $class)) {
                      $manager = $objectManager;
  
                      break;
                  }
              }
          }
  
          return $manager;
      }
code_tokens: public static function getManager ( ManagerRegistry $ or , $ class ) { $ manager = $ or -> getManagerForClass ( $ class ) ; if ( null === $ manager ) { foreach ( $ or -> getManagers ( ) as $ objectManager ) { if ( $ objectManager -> getMetadataFactory ( ) -> hasMetadataFor ( $ class ) && self :: isValidManager ( $ objectManager , $ class ) ) { $ manager = $ objectManager ; break ; } } } return $ manager ; }
docstring: Get the doctrine object manager of the class.
  
  @param ManagerRegistry $or    The doctrine registry
  @param string          $class The class name or doctrine shortcut class name
  
  @return null|ObjectManager
docstring_tokens: Get the doctrine object manager of the class .