Download the PHP package fivesqrd/bego without Composer
On this page you can find all versions of the php package fivesqrd/bego. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fivesqrd/bego
More information about fivesqrd/bego
Files in fivesqrd/bego
Informations about the package bego
Bego
Bego is a PHP library that makes working DynamoDb tables simpler.
Working with models
Create your table's model class
Instantiating a table
Instantiate the tables you need throughout your app...
Working with queries
You can Query any DynamoDb table or secondary index, provided that it has a composite primary key (partition key and sort key)
Key condition and filter expressions
Multiple key condition / filter expressions can be added. DynamoDb applies key conditions to the query but filters are applied to the query results
Descending Order
DynamoDb always sorts results by the sort key value in ascending order. Getting results in descending order can be done using the reverse() flag:
Projecting attributes
To get just some, rather than all of the attributes, use a projection expression.
Working with result sets
The result set object implements the Iterator interface and canned by used straight way. It provived some handy methods as well.
Consistent Reads
DynamoDb performs eventual consistent reads by default. For strongly consistent reads set the consistent() flag:
Limiting Results
DynamoDb allows you to limit the number of items returned in the result. Note that this limit is applied to the key conidtion only. DynamoDb will apply filters after the limit is imposed on the result set:
Paginating
DynanmoDb limits the results to 1MB. Therefor, pagination has to be implemented to traverse beyond the first page. There are two options available to do the pagination work:
In some cases one may want to paginate accross multiple hops;
Capacity Units Consumed
DynamoDb can calculate the total number of read capacity units for every query. This can be enabled using the consumption() flag:
Performing a scan
Basic table scan's are supported. Filter expressions, results and pagination work the same as with queries
Create an item
Batch writing will automatically deal with a) DynamoDb's batch size limits, b) efficiency, i.e. running multiple workers in parallel, c) handling unresolved items and d) retrying any errors due to provision limits
Get an item
Working with item's attribute values
Update an item
Making use of an item's magic properties instead of set() and attribute()
Conditional update
Delete an item
/ Delete multiple items with batch writing /