Table 4.1. PHP Client Library Retrieval Methods
| Method | Title |
|---|---|
$object->fetch($key [, $keyn ]) | Fetch the next delayed result set document |
$object->fetchAll($key [, $keyn ]) | Fetch all the delayed result set documents |
$object->get($key [, $callback ] [, $casunique ]) | Get one or more key values |
$object->getDelayed($keyn [, $with_cas ] [, $callback ]) | Get a key to be fetched later |
$object->getMulti($keycollection [, $casarray ]) | Get one or more key values |
$object->getAndLock($key [, $casarray ] [, $getl-expiry ]) | Get the value for a key, lock the key from changes |
$object->getAndLockMulti($keycollection [, $casarray ] [, $getl-expiry ]) | Get the value for a key, lock the key from changes |
$object->getAndTouch($key, $expiry) | Get a value and update the expiration time for a given key |
$object->getAndTouchMulti($key, $expiry) | Get a value and update the expiration time for a given key |
$object->unlock($key, $casunique) | Unlock a previously locked key |
| API Call | $object->get($key [, $callback ] [, $casunique ]) | ||
| Asynchronous | no | ||
| Description | Get one or more key values | ||
| Returns | scalar; supported values: | ||
COUCHBASE_KEY_ENOENT | Requested document ID does not exist | ||
object | Requested 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 | ||
| API Call | $object->getMulti($keycollection [, $casarray ]) | ||
| Asynchronous | no | ||
| Description | Get one or more key values | ||
| Returns | array (
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 | ||
| API Call | $object->getDelayed($keyn [, $with_cas ] [, $callback ]) | ||
| Asynchronous | yes | ||
| Description | Get one or more key values | ||
| Returns | boolean; supported values: | ||
COUCHBASE_KEY_ENOENT | Requested document ID does not exist | ||
COUCHBASE_SUCCESS | Operation succeeded | ||
| Arguments | |||
array $keyn | One or more keys used to reference a value | ||
boolean $with_cas | Whether to return the CAS value for a document | ||
mixed $callback | Callback function or method to be called | ||
| API Call | $object->fetch($key [, $keyn ]) | ||
| Asynchronous | yes | ||
| Description | Fetch the next delayed result set document | ||
| Returns | array (
An array of the next document retrieved, or NULL if no more
documents
) | ||
| Arguments | |||
string $key | Document ID used to identify the value | ||
array $keyn | One or more keys used to reference a value | ||
| API Call | $object->fetchAll($key [, $keyn ]) | ||
| Asynchronous | yes | ||
| Description | Fetch all the delayed result set documents | ||
| Returns | array (
An array of all the remaining documents retrieved, or NULL if no
more documents
) | ||
| Arguments | |||
string $key | Document ID used to identify the value | ||
array $keyn | One or more keys used to reference a value | ||
| API Call | $object->getByKey($master_key, $key [, $cache_callback ] [, $casunique ]) | ||
| Asynchronous | no | ||
| Description | Get one or more key values | ||
| Returns | scalar (
Binary object
) | ||
| Arguments | |||
$master_key | Master key used for consistent server references | ||
string $key | Document ID used to identify the value | ||
scalar $cache_callback | Function to be called in the form function($key, $value) | ||
$casunique | Unique value used to verify a key/value combination | ||
| API Call | $object->getDelayedByKey($master_key, $keyn [, $with_cas ] [, $callback ]) | ||
| Asynchronous | no | ||
| Description | Get one or more key values | ||
| Returns | scalar (
Binary object
) | ||
| Arguments | |||
$master_key | Master key used for consistent server references | ||
array $keyn | One or more keys used to reference a value | ||
boolean $with_cas | Whether to return the CAS value for a document | ||
mixed $callback | Callback function or method to be called | ||
| API Call | $object->getMultiByKey($master_key, $keyn [, $cas_token ] [, $flags ]) | ||
| Asynchronous | no | ||
| Description | Get one or more key values | ||
| Returns | scalar (
Binary object
) | ||
| Arguments | |||
$master_key | Master key used for consistent server references | ||
array $keyn | One or more keys used to reference a value | ||
float $cas_token | CAS token for conditional operations | ||
$flags | Flags for storage options. Flags are ignored by the server byt preserved for use by the client. | ||
| API Call | $object->getResultCode() | ||
| Asynchronous | no | ||
| Description | Returns the result code for the last operation | ||
| Returns | () | ||
| Arguments | |||
| None | |||