Imbo\Storage\GridFS::getMongoClient PHP Method

getMongoClient() protected method

Get the mongo client instance
protected getMongoClient ( ) : MongoClient
return MongoClient
    protected function getMongoClient()
    {
        if ($this->mongoClient === null) {
            try {
                $this->mongoClient = new MongoClient($this->params['server'], $this->params['options']);
            } catch (MongoException $e) {
                throw new StorageException('Could not connect to database', 500, $e);
            }
        }
        return $this->mongoClient;
    }