Returns all of the attributes associated with the item. Optionally, the attributes returned can be limited to one or more specified attribute name parameters.
If the item does not exist on the replica that was accessed for this operation, an empty set is returned. The system does not return an error as it cannot guarantee the item does not exist on other replicas.
If you specify GetAttributes without any attribute names, all the attributes for the item are returned.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the domain in which to perform the operation. |
|
|
Required |
The name of the base item which will contain the series of keypairs. |
|
|
Optional |
The names of the attributes. Pass a string for a single value, or an indexed array for multiple values. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Get attributes for an entire item.
// Instantiate $sdb = new AmazonSDB(); $response = $sdb->get_attributes('example-domain', 'unit-test'); // Success? var_dump($response->isOK());Result:
bool(true)
Get attributes for a specific attribute under an item.
// Instantiate $sdb = new AmazonSDB(); $response = $sdb->get_attributes('example-domain', 'unit-test', 'key1'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/sdb.class.php | Toggle source view (15 lines) | View on GitHub