Imbo\Storage\GridFS::getGrid PHP Method

getGrid() protected method

Get the grid instance
protected getGrid ( ) : MongoGridFS
return MongoGridFS
    protected function getGrid()
    {
        if ($this->grid === null) {
            try {
                $database = $this->getMongoClient()->selectDB($this->params['databaseName']);
                $this->grid = $database->getGridFS();
            } catch (MongoException $e) {
                throw new StorageException('Could not connect to database', 500, $e);
            }
        }
        return $this->grid;
    }