Public Member Functions

RiakBucket Class Reference

Public Member Functions

 RiakBucket ($client, $name)
 getName ()
 getR ($r=NULL)
 setR ($r)
 getW ($w)
 setW ($w)
 getDW ($dw)
 setDW ($dw)
 newObject ($key, $data=NULL)
 newBinary ($key, $data, $content_type='text/json')
 get ($key, $r=NULL)
 getBinary ($key, $r=NULL)
 setNVal ($nval)
 getNVal ()
 setAllowMultiples ($bool)
 getAllowMultiples ()
 setProperty ($key, $value)
 getProperty ($key)
 setProperties ($props)
 getProperties ()

Member Function Documentation

get ( key,
r = NULL 
)

Retrieve a JSON-encoded object from Riak.

Parameters:
string$key- Name of the key.
int$r- R-Value of the request (defaults to bucket's R)
Returns:
RiakObject
getAllowMultiples (  )

Retrieve the 'allow multiples' setting.

Returns:
Boolean
getBinary ( key,
r = NULL 
)

Retrieve a binary/string object from Riak.

Parameters:
string$key- Name of the key.
int$r- R-Value of the request (defaults to bucket's R)
Returns:
RiakObject
getDW ( dw )

Get the DW-value for this bucket, if it is set, otherwise return the DW-value for the client.

Returns:
integer
getName (  )

Get the bucket name.

getNVal (  )

Retrieve the N-value for this bucket.

Returns:
integer
getProperties (  )

Retrieve an associative array of all bucket properties.

Returns:
Array
getProperty ( key )

Retrieve a bucket property.

Parameters:
string$key- The property to retrieve.
Returns:
mixed
getR ( r = NULL )

Get the R-value for this bucket, if it is set, otherwise return the R-value for the client.

Returns:
integer
getW ( w )

Get the W-value for this bucket, if it is set, otherwise return the W-value for the client.

Returns:
integer
newBinary ( key,
data,
content_type = 'text/json' 
)

Create a new Riak object that will be stored as plain text/binary.

Parameters:
string$key- Name of the key.
object$data- The data to store.
string$content_type- The content type of the object. (default 'text/json')
Returns:
RiakObject
newObject ( key,
data = NULL 
)

Create a new Riak object that will be stored as JSON.

Parameters:
string$key- Name of the key.
object$data- The data to store. (default NULL)
Returns:
RiakObject
RiakBucket ( client,
name 
)
setAllowMultiples ( bool )

If set to true, then writes with conflicting data will be stored and returned to the client. This situation can be detected by calling hasSiblings() and getSiblings(). This should only be used if you know what you are doing.

Parameters:
boolean$bool- True to store and return conflicting writes.
setDW ( dw )

Set the DW-value for this bucket. See setR(...) for more information.

Parameters:
integer$dw- The new DW-value
Returns:
$this
setNVal ( nval )

Set the N-value for this bucket, which is the number of replicas that will be written of each object in the bucket. Set this once before you write any data to the bucket, and never change it again, otherwise unpredictable things could happen. This should only be used if you know what you are doing.

Parameters:
integer$nval- The new N-Val.
setProperties ( props )

Set multiple bucket properties in one call. This should only be used if you know what you are doing.

Parameters:
array$props- An associative array of $key=>$value.
setProperty ( key,
value 
)

Set a bucket property. This should only be used if you know what you are doing.

Parameters:
string$key- Property to set.
mixed$value- Property value.
setR ( r )

Set the R-value for this bucket. get(...) and getBinary(...) operations that do not specify an R-value will use this value.

Parameters:
integer$r- The new R-value.
Returns:
$this
setW ( w )

Set the W-value for this bucket. See setR(...) for more information.

Parameters:
integer$w- The new W-value.
Returns:
$this

The documentation for this class was generated from the following file: