class Bucket (View source)

Bucket is an object containing functionality for performing bucket level operations against a cluster and for access to scopes and collections.

Methods

defaultScope()

Returns a new Scope object representing the default scope.

defaultCollection()

Returns a new Collection object representing the default collectiom.

scope(string $name)

Returns a new Scope object representing the given scope.

setTranscoder(callable $encoder, callable $decoder)

Sets the default transcoder to be used when fetching or sending data.

string
name()

Returns the name of the Bucket.

viewQuery(string $designDoc, string $viewName, ViewOptions $options = null)

Executes a view query against the cluster.

collections()

Creates a new CollectionManager object for managing collections and scopes.

viewIndexes()

Creates a new ViewIndexManager object for managing views and design documents.

ping(mixed $services, mixed $reportId)

Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.

diagnostics(mixed $reportId)

Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.

Details

Scope defaultScope()

Returns a new Scope object representing the default scope.

Return Value

Scope

Collection defaultCollection()

Returns a new Collection object representing the default collectiom.

Return Value

Collection

Scope scope(string $name)

Returns a new Scope object representing the given scope.

Parameters

string $name

the name of the scope

Return Value

Scope

setTranscoder(callable $encoder, callable $decoder)

Sets the default transcoder to be used when fetching or sending data.

Parameters

callable $encoder

the encoder to use to encode data when sending data to the server

callable $decoder

the decoder to use to decode data when retrieving data from the server

string name()

Returns the name of the Bucket.

Return Value

string

ViewResult viewQuery(string $designDoc, string $viewName, ViewOptions $options = null)

Executes a view query against the cluster.

Parameters

string $designDoc

the design document to use for the query

string $viewName

the view to use for the query

ViewOptions $options

the options to use when executing the query

Return Value

ViewResult

CollectionManager collections()

Creates a new CollectionManager object for managing collections and scopes.

Return Value

CollectionManager

ViewIndexManager viewIndexes()

Creates a new ViewIndexManager object for managing views and design documents.

Return Value

ViewIndexManager

ping(mixed $services, mixed $reportId)

Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.

Parameters

mixed $services

the services to ping against

mixed $reportId

a name which will be included within the ping result

diagnostics(mixed $reportId)

Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.

Parameters

mixed $reportId

a name which will be included within the ping result