Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: PHP 1.1
Community Wiki and Resources
Wiki: PHP Client Library
PHP Client Library
Couchbase Developer Guide 2.0
Couchbase Server Manual 2.0
SDK Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
6 Retrieve Operations
Chapter Sections
Chapters

6.1. Basic Get Operations

API Call$object->get($key [, $callback ] [, $casunique ])
Asynchronousno
Description Get one or more key values
Returnsscalar; supported values:
 COUCHBASE_KEY_ENOENTRequested document ID does not exist 
 objectRequested object 
Arguments 
string $key Document ID used to identify the value
mixed $callback Callback function or method to be called
$casunique Unique value used to verify a key/value combination
Errors 
CouchbaseAuthenticationException Authentication to the Couchbase cluster failed
CouchbaseException Base exception class for all Couchbase exceptions
CouchbaseIllegalKeyException The key provided is not a legal key identifier
CouchbaseLibcouchbaseException An error occurred within the libcouchbase library used by th PHP extension
CouchbaseServerException An error occurred within the Couchbase cluster

The $casunique argument is a variable passed by reference in which the client library will place the current CAS value for this document. Note that it must be passed by reference. Sometimes this is referred to as an out variable.

API Call$object->getMulti($keycollection [, $casarray ])
Asynchronousno
Description Get one or more key values
Returnsarray ( Array of key/value pairs for each document, or key/error condition for each failure )
Arguments 
array $keycollection One or more keys used to reference a value
array $casarray Array of unique values used to verify a key/value combination