code: public function getResource()
      {
          if ($this->file instanceof \Doctrine\MongoDB\GridFSFile) {
              return $this->file->getMongoGridFSFile()->getResource();
          }
          return null;
      }
docs: Gets the resource of a file
  
  @return null|\stream