original_string: public function get($entityOrDocumentNameOrId)
      {
          // @Support legacy method of adding/removing grid sources
          if (isset($this->extraGridSources[$entityOrDocumentNameOrId])) {
              return $this->extraGridSources[$entityOrDocumentNameOrId];
          }
  
          if (isset($this->sourcesByClass[$entityOrDocumentNameOrId])) {
              return $this->sourcesByClass[$entityOrDocumentNameOrId];
          }
  
          if (isset($this->sourcesByName[$entityOrDocumentNameOrId])) {
              return $this->sourcesByName[$entityOrDocumentNameOrId];
          }
  
          try {
              if ($this->registry && ($manager = $this->registry->getManagerForClass($entityOrDocumentNameOrId)) &&
                  $gridSource = $this->getGridSource($manager, $entityOrDocumentNameOrId)) {
                  return $gridSource;
              }
          } catch (\ReflectionException $exception) {
          }
  
          if ($this->mongodbRegistry && ($manager = $this->mongodbRegistry->getManagerForClass($entityOrDocumentNameOrId)) &&
              $gridSource = $this->getGridSource($manager, $entityOrDocumentNameOrId)) {
              return $gridSource;
          }
          throw new \Exception("Can't find grid source for $entityOrDocumentNameOrId");
      }
code: public function get($entityOrDocumentNameOrId)
      {
          // @Support legacy method of adding/removing grid sources
          if (isset($this->extraGridSources[$entityOrDocumentNameOrId])) {
              return $this->extraGridSources[$entityOrDocumentNameOrId];
          }
  
          if (isset($this->sourcesByClass[$entityOrDocumentNameOrId])) {
              return $this->sourcesByClass[$entityOrDocumentNameOrId];
          }
  
          if (isset($this->sourcesByName[$entityOrDocumentNameOrId])) {
              return $this->sourcesByName[$entityOrDocumentNameOrId];
          }
  
          try {
              if ($this->registry && ($manager = $this->registry->getManagerForClass($entityOrDocumentNameOrId)) &&
                  $gridSource = $this->getGridSource($manager, $entityOrDocumentNameOrId)) {
                  return $gridSource;
              }
          } catch (\ReflectionException $exception) {
          }
  
          if ($this->mongodbRegistry && ($manager = $this->mongodbRegistry->getManagerForClass($entityOrDocumentNameOrId)) &&
              $gridSource = $this->getGridSource($manager, $entityOrDocumentNameOrId)) {
              return $gridSource;
          }
          throw new \Exception("Can't find grid source for $entityOrDocumentNameOrId");
      }
code_tokens: public function get ( $ entityOrDocumentNameOrId ) { // @Support legacy method of adding/removing grid sources if ( isset ( $ this -> extraGridSources [ $ entityOrDocumentNameOrId ] ) ) { return $ this -> extraGridSources [ $ entityOrDocumentNameOrId ] ; } if ( isset ( $ this -> sourcesByClass [ $ entityOrDocumentNameOrId ] ) ) { return $ this -> sourcesByClass [ $ entityOrDocumentNameOrId ] ; } if ( isset ( $ this -> sourcesByName [ $ entityOrDocumentNameOrId ] ) ) { return $ this -> sourcesByName [ $ entityOrDocumentNameOrId ] ; } try { if ( $ this -> registry && ( $ manager = $ this -> registry -> getManagerForClass ( $ entityOrDocumentNameOrId ) ) && $ gridSource = $ this -> getGridSource ( $ manager , $ entityOrDocumentNameOrId ) ) { return $ gridSource ; } } catch ( \ ReflectionException $ exception ) { } if ( $ this -> mongodbRegistry && ( $ manager = $ this -> mongodbRegistry -> getManagerForClass ( $ entityOrDocumentNameOrId ) ) && $ gridSource = $ this -> getGridSource ( $ manager , $ entityOrDocumentNameOrId ) ) { return $ gridSource ; } throw new \ Exception ( "Can't find grid source for $entityOrDocumentNameOrId" ) ; }
docstring: Get a gridsource.
  
  @param string                             $id      Entity or Document
  @param EntityManager|DocumentManager|null $manager (optional) Entity or Document manager to use (overrides default)
  
  @return GridSourceInterface|null
  
  @throws \Exception
docstring_tokens: Get a gridsource .