Download the PHP package pluginscart/dynamodb-php without Composer
On this page you can find all versions of the php package pluginscart/dynamodb-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pluginscart/dynamodb-php
More information about pluginscart/dynamodb-php
Files in pluginscart/dynamodb-php
Package dynamodb-php
Short Description Access AWS DynamoDB through simpler interface in PHP.
License MIT
Informations about the package dynamodb-php
dynamodb-php-wrapper
Access AWS DynamoDB through simpler interface in PHP
This module, dynamodb-php-wrapper, allows you to access DynamoDB more easily through interfaces shown below.
Each interface is just a wrapper, so accepts same arguments original one does and you can get that information from the document provided by AWS if needed.
This section assumes that:
- There is a table 'User', which has hash key 'UserId' as Number.
- There is a table 'Friend', which has hash key 'UserId' as Number and range key 'FriendUserId' as Number.
init
First of all, DynamoDBWrapper needs to be instantiated like this:
then, you can access DynamoDB through this instance.
get
get is a wrapper of GetItem and will be used like this:
batchGet
batchGet is a wrapper of BatchGetItem and will be used like this:
batchGet can get more than 25 items by one call. This wrapper sends multiple requests to DynamoDb if needed, and merge them as a single result.
query
query is a wrapper of Query and will be used like this:
query can accept options as $options, such as Limit, ExclusiveStartKey, ScanIndexForward and IndexName. If you use SLI, IndexName must be included in options.
scan
scan is a wrapper of Scan and will be used like this:
count
count is a wrapper of Query with Select param as COUNT. This return the number of items query fetches and will be used like this:
put
put is a wrapper of putItem and will be used like this:
If operation needs to be conditional, you can specify the expectation like this:
batchPut
batchPut is a wrapper of BatchWriteItem with put requests and will be used like this:
If the number of requests is more than 25, this module divides the requests and send them continuously until all of requests are completed.
update
update is a wrapper of UpdateItem and will be used like this:
If operation succeeded, the updated value will be returned. If operation needs to be conditional, you can specify the expectation as 3rd arg.
delete
delete is a wrapper of DeleteItem and will be used like this:
If operation succeeded, the deleted item will be returned.
batchDelete
batchDelete is a wrapper of BatchWriteItem with put requests and will be used like this:
If the number of requests is more than 25, this module divides the requests and send them continuously until all of requests are completed.
createTable
createTable is a wrapper of CreateTable and will be used like this:
If LSI is needed, it can be added like this:
After requested, it will wait for completion.