Installation guide

'id' => $itemId,
'timestamp' => time(),
));
$putBatch->add(new PutRequest($item, $tableName));
}
$putBatch->flush();
You can also use the WriteRequestBatch object to delete items in batches.
// Remove items from the table
$deleteBatch = WriteRequestBatch::factory($client);
foreach ($itemIds as $itemId) {
$key = array('id' => array('S' => $itemId));
$deleteBatch->add(new DeleteRequest($key, $tableName));
}
$deleteBatch->flush();
The WriteRequestBatch, PutRequest, and DeleteRequest classes are all a part of the
Aws\DynamoDb\Model\BatchRequest namespace.
API Reference
Please see the Amazon DynamoDB Client API reference for a details about all of the available methods, including
descriptions of the inputs and outputs.
BatchGetItem BatchWriteItem
CreateTable DeleteItem
DeleteTable DescribeTable
GetItem ListTables
PutItem Query
Scan UpdateItem
UpdateTable
Amazon DynamoDB (2011-12-05)
This guide focuses on the AWS SDK for PHP client for Amazon DynamoDB. This guide assumes that you have
already downloaded and installed the AWS SDK for PHP. See Installation for more information on getting started.
Note: This guide is for the 2011-12-05 API version of Amazon DynamoDB. You may also be interested in the guide
for the latest API version of Amazon DynamoDB.
Creating a client
First you need to create a client object using one of the following techniques.
Factory method
The easiest way to get up and running quickly is to use the Aws\DynamoDb\DynamoDbClient::factory()
method and provide your credentials (key and secret).
A region parameter is also required and must be set to one of the following values: us-east-1,
ap-northeast-1, sa-east-1, ap-southeast-1, ap-southeast-2, us-west-2, us-gov-west-1,
us-west-1, cn-north-1, eu-west-1
use Aws\DynamoDb\DynamoDbClient;
$client = DynamoDbClient::factory(array(
'key' => '<aws access key>',
'secret' => '<aws secret key>',
Amazon DynamoDB (2011-12-05)
73