Documentation

Bucket
in package
implements BucketInterface

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

Tags
since
4.0.0

Interfaces, Classes, Traits and Enums

BucketInterface

Table of Contents

$core  : resource
$name  : string
collections()  : CollectionManager
Creates a new CollectionManager object for managing collections and scopes.
defaultCollection()  : Collection
Returns a new Collection object representing the default collection.
defaultScope()  : Scope
Returns a new Scope object representing the default scope.
diagnostics()  : mixed
Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.
name()  : string
Returns the name of the Bucket.
ping()  : mixed
Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.
scope()  : Scope
Returns a new Scope object representing the given scope.
setTranscoder()  : mixed
Sets the default transcoder to be used when fetching or sending data.
viewIndexes()  : ViewIndexManager
Creates a new ViewIndexManager object for managing views and design documents.
viewQuery()  : ViewResult
Executes a view query against the cluster.

Properties

Methods

defaultCollection()

Returns a new Collection object representing the default collection.

public defaultCollection() : Collection
Tags
since
4.0.0
Return values
Collection

defaultScope()

Returns a new Scope object representing the default scope.

public defaultScope() : Scope
Tags
since
4.0.0
Return values
Scope

diagnostics()

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

public diagnostics([string|null $reportId = null ]) : mixed
Parameters
$reportId : string|null = null

a name which will be included within the ping result

Tags
deprecated
  • see cluster->diagnostics
since
4.0.0
Return values
mixed

name()

Returns the name of the Bucket.

public name() : string
Tags
since
4.0.0
Return values
string

ping()

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

public ping([mixed|null $services = null ][, mixed|null $reportId = null ]) : mixed
Parameters
$services : mixed|null = null

the services to ping against

$reportId : mixed|null = null

a name which will be included within the ping result

Tags
see
ServiceType::KEY_VALUE
see
ServiceType::QUERY
see
ServiceType::ANALYTICS
see
ServiceType::SEARCH
see
ServiceType::VIEWS
see
ServiceType::MANAGEMENT
see
ServiceType::EVENTING
since
4.0.0
Return values
mixed

scope()

Returns a new Scope object representing the given scope.

public scope(string $name) : Scope
Parameters
$name : string

the name of the scope

Tags
since
4.0.0
Return values
Scope

setTranscoder()

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

public setTranscoder(callable $encoder, callable $decoder) : mixed
Parameters
$encoder : callable

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

$decoder : callable

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

Tags
throws
UnsupportedOperationException
since
4.0.0
Return values
mixed

viewQuery()

Executes a view query against the cluster.

public viewQuery(string $designDoc, string $viewName[, ViewOptions|null $options = null ]) : ViewResult
Parameters
$designDoc : string

the design document to use for the query

$viewName : string

the view to use for the query

$options : ViewOptions|null = null

the options to use when executing the query

Tags
since
4.0.0
Return values
ViewResult

        

Search results