protected function gridFindOne($name)
    {
        try {
            $params = ['filename' => $name];
            $obj = $this->gridFS->findOne($params);
        } catch (ConnectionTimeoutException $ex) {
            throw new ConnectionTimeoutException($ex);
        } catch (\Exception $ex) {
            throw new NotFoundException('Could not find file "' . $name . '": ' . $ex->getMessage());
        }

        return $obj;
    }
protected function gridFindOne($name)
    {
        try {
            $params = ['filename' => $name];
            $obj = $this->gridFS->findOne($params);
        } catch (ConnectionTimeoutException $ex) {
            throw new ConnectionTimeoutException($ex);
        } catch (\Exception $ex) {
            throw new NotFoundException('Could not find file "' . $name . '": ' . $ex->getMessage());
        }

        return $obj;
    }
protected function gridFindOne ( $ name ) { try { $ params = [ 'filename' => $ name ] ; $ obj = $ this -> gridFS -> findOne ( $ params ) ; } catch ( ConnectionTimeoutException $ ex ) { throw new ConnectionTimeoutException ( $ ex ) ; } catch ( \ Exception $ ex ) { throw new NotFoundException ( 'Could not find file "' . $ name . '": ' . $ ex -> getMessage ( ) ) ; } return $ obj ; }
finds a file based on filename from gridfs

@param $name string name of the file to find.

@return object file collection
finds a file based on filename from gridfs