class Scope (View source)

Scope is an object for providing access to collections.

Methods

__construct(Bucket $bucket, string $name)

No description

string
name()

Returns the name of the scope.

collection(string $name)

Returns a new Collection object representing the collection specified.

query(string $statement, QueryOptions $options = null)

Executes a N1QL query against the cluster with scopeName set implicitly.

analyticsQuery(string $statement, AnalyticsOptions $options = null)

Executes an analytics query against the cluster with scopeName set implicitly.

Details

__construct(Bucket $bucket, string $name)

No description

Parameters

Bucket $bucket
string $name

string name()

Returns the name of the scope.

Return Value

string

Collection collection(string $name)

Returns a new Collection object representing the collection specified.

Parameters

string $name

the name of the collection

Return Value

Collection

QueryResult query(string $statement, QueryOptions $options = null)

Executes a N1QL query against the cluster with scopeName set implicitly.

Parameters

string $statement

the N1QL query statement to execute

QueryOptions $options

the options to use when executing the query

Return Value

QueryResult

AnalyticsResult analyticsQuery(string $statement, AnalyticsOptions $options = null)

Executes an analytics query against the cluster with scopeName set implicitly.

Parameters

string $statement

the analytics query statement to execute

AnalyticsOptions $options

the options to use when executing the query

Return Value

AnalyticsResult