Installation guide

// Update the provisioned throughput capacity of the table
$client->updateTable(array(
'TableName' => 'errors',
'ProvisionedThroughput' => array(
'ReadCapacityUnits' => 15,
'WriteCapacityUnits' => 25
)
));
// Wait until the table is active again after updating
$client->waitUntilTableExists(array(
'TableName' => 'errors'
));
Describing a table
Now that the table is created, you can use the describeTable() method to get information about the table.
$result = $client->describeTable(array(
'TableName' => 'errors'
));
// The result of an operation can be used like an array
echo $result['Table']['ItemCount'] . "\n";
//> 0
// Use the getPath() method to retrieve deeply nested array key values
echo $result->getPath('Table/ProvisionedThroughput/ReadCapacityUnits') . "\n";
//> 15
The return value of the describeTable() method is a Guzzle\Service\Resource\Model object that can be
used like an array. For example, you could retrieve the number of items in a table or the amount of provisioned read
throughput.
Listing tables
You can retrieve a list of all of the tables associated with a specific endpoint using the listTables() method. Each
Amazon DynamoDB endpoint is entirely independent. For example, if you have two tables called "MyTable," one in
US-EAST-1 and one in US-WEST-2, they are completely independent and do not share any data. The ListTables
operation returns all of the table names associated with the account making the request, for the endpoint that
receives the request.
$result = $client->listTables();
// TableNames contains an array of table names
foreach ($result['TableNames'] as $tableName) {
echo $tableName . "\n";
}
Iterating over all tables
The result of a listTables() operation might be truncated. Because of this, it is usually better to use an iterator
to retrieve a complete list of all of the tables owned by your account in a specific region. The iterator will
automatically handle sending any necessary subsequent requests.
$iterator = $client->getIterator('ListTables');
foreach ($iterator as $tableName) {
echo $tableName . "\n";
}
Amazon DynamoDB (2011-12-05)
75