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");
    }