\CouchbaseAnalyticsQuery

Represents a Analytics query (currently experimental support).

Summary

Methods
Properties
Constants
fromString()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

fromString()

fromString(string  $statement) : \Couchbase\AnalyticsQuery

Creates new AnalyticsQuery instance directly from the string.

Parameters

string $statement

statement string

Returns

\Couchbase\AnalyticsQuery

Examples

<?php
$cluster = new \Couchbase\Cluster('couchbase://localhost?detailed_errcodes=1');
$cluster->authenticateAs('Administrator', 'password');
$bucket = $cluster->openBucket('default');

$query = \Couchbase\AnalyticsQuery::fromString('SELECT "Hello, beer!" AS greeting;');
var_dump($res->rows[0]);
//=> object(stdClass)#4 (1) {
//     ["greeting"]=>
//     string(12) "Hello, beer!"
//   }