\Riak\Object
category |
Basho |
---|---|
author |
Riak team (https://github.com/basho/riak-php-client/contributors) |
__construct(\Basho\Riak\Client $client, \Basho\Riak\Bucket $bucket, string $key = NULL)
\Basho\Riak\Client
string
getKey() : string
string
getData() : array|string
Will return a associative array, unless the object was constructed with newBinary(...) or getBinary(...), in which case this will return a string.
array|string
setData(mixed $data) : Object
This data will be JSON encoded unless the object was constructed with newBinary(...) or getBinary(...).
mixed
Object
status() : integer
integer
exists() : boolean
Allows you to detect a get(...) or getBinary(...) operation where the object is missing.
boolean
getContentType() : string
This is either application/json, or the provided content type if the object was created via newBinary(...).
string
setContentType(string $content_type) : $this
string
$this
getLastModified() : \Basho\Riak\DateTime
\Basho\Riak\DateTime
addLink(mixed $obj, string $tag = NULL) : Object
mixed
string
Object
removeLink(mixed $obj, string $tag = NULL) : $this
mixed
string
$this
getLinks() : \Basho\Riak\array()
\Basho\Riak\array()
addIndex(string $indexName, string $indexType = null, $explicitValue = null) : $this
This will create the index if it does not exist, or will append an additional value if the index already exists and does not contain the provided value.
string
string
$this
setIndex(string $indexName, string $indexType = null, array|string|int $values) : $this
string
string
array|string|int
$this
getIndex(string $indexName, string $indexType = null)
Note, the NULL value has special meaning - when the object is ->store()d, this value will be replaced with the current value the value of the field matching $indexName from the object's data
string
string
removeIndex(string $indexName, string $indexType = null, $explicitValue = null) : $this
string
string
$this
removeAllIndexes($indexName = null, $indexType = null) : $this
If $indexName and $indexType are provided, all values for the identified index are removed. If just $indexName is provided, all values for all types of the identified index are removed If neither is provided, all indexes are removed from the object
Note that this function will NOT affect auto indexes
$this
addAutoIndex(string $fieldName, string $indexType = null) : $this
The value of an automatic secondary index is determined at time of ->store() by looking for an $fieldName key in the object's data.
string
string
Must be one of 'int' or 'bin'
$this
hasAutoIndex(string $fieldName, string $indexType = null) : boolean
string
string
boolean
removeAutoIndex(string $fieldName, string $indexType = null) : $this
string
string
$this
removeAllAutoIndexes(string $fieldName = null, string $indexType = null) : $this
If $fieldName is not provided, all auto indexes on the object are stripped, otherwise just indexes on the given field are stripped. If $indexType is not provided, all types of index for the given field are stripped, otherwise just a given type is stripped.
string
string
$this
getMeta(string $metaName) : string|null
Returns null if no metadata value with the given name exists
string
string|null
setMeta(string $metaName, string $value) : $this
Overwrites an existing value with the same name if it exists.
string
string
$this
removeMeta(string $metaName) : $this
string
$this
getAllMeta() : \Basho\Riak\array<string>=string
\Basho\Riak\array=string
removeAllMeta() : \Basho\Riak\$this;
\Basho\Riak\$this;
store(integer $w = NULL, integer $dw = NULL) : $this
When this operation completes, the object could contain new metadata and possibly new data if Riak contains a newer version of the object according to the object's vector clock.
integer
integer
$this
reload(integer $r = NULL) : $this
When this operation completes, the object could contain new metadata and a new value, if the object was updated in Riak since it was last retrieved.
integer
$this
delete(integer $dw = NULL) : $this
integer
$this
clear() : $this
$this
vclock() : string
string
hasSiblings() : boolean
boolean
getSiblingCount() : integer
integer
getSibling(integer $i, integer $r = NULL) : \Basho\Riak\Object.
integer
integer
\Basho\Riak\Object.
getSiblings(integer $r = NULL) : array
integer
array
of Object
add($params) : \Basho\Riak\MapReduce
link($params) : \Basho\Riak\MapReduce
map($params) : \Basho\Riak\MapReduce
reduce($params) : \Basho\Riak\MapReduce
indexes
var |
Array of indexes |
---|---|
see | |
autoIndexes
var |
Array of automatic indexes |
---|---|
see | |