Download the PHP package autoprotect-group/php-dynamodb-odm without Composer

On this page you can find all versions of the php package autoprotect-group/php-dynamodb-odm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-dynamodb-odm

AWS Dynamodb ODM for PHP

Code style, unit and functional tests

This is a library and an Object Document Mapper to use with AWS DynamoDB in a more convenient way.

Usage

Configure the ODM

Set up native client:

Set up the main operations lib client:

Set up the marshaller. Native AWS marshaller may be taken:

Set up the Query builder:

Set up annotation reader and annotation manager:

The hydrators for the models:

Serializer for inserting records into DB:

The full example is in here.

Model

Model field types

The lib operates with models. Each model may have various supported field types. Here is a list of types which correlate with PHP and Dynamodb types:

Here is a model example:

Model full example is here: model.php

Enumerations example

Enumerations are also supported. Here is an example of the model with enumeration fields:

Fields encryption

Certain types custom encryption is supported. In case there are some fields which needs to be encrypted.

First of all we need to create a custom encryptor:

Then the decryptor should be passed into the hydrator:

And the model may be the following:

Set up the repository for your model

The best way to operate with records is to create a repository. There is a built-in already:

There are built-in operation in the default repository.

Get model by partition Id

Just by partition key
By partition key and sort key
Non-consistent read
Get one item

Insert model

Delete item

Document repository

Sometimes we need to fetch not the whole model, but just a part of it. For this purpose there is such called DocumentRepository. The part of the document may be technically fetched using native DynamoDb projection expressions.

Setting DocumentRepository up:

Get a model by projection expression

Get a specific scalar property by projection expression

Get/create/update/delete operations

Document repository supports specific property get/create/update/delete operations:

Query builder

Another powerful feature is query builders. This adds flexibility to fetch items by specific criteria which is supported by DynamoDB.

This is a way to work with the Dynamodb using raw queries and results

Get query builder

Fetch items:

Update query builder

Ability to update specific attributes.

Local dev environment installation

  1. In order to build a dev image, please, run:

  2. Then run to install dependencies:

Running tests

Unit tests

This package uses phpspec for running unit tests.

Run them using the following way:

One can use environment variables in the .env.local file to be able to debug the library. For this just Copy file .env.local and set up the variable according to your OS.

And then run the tests with:

Functional tests

This package uses behat for running functional tests.

Then just run the tests:

Syntax check tests

You need to check if the code style is OK by running:


All versions of php-dynamodb-odm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
aws/aws-sdk-php Version ^3.218
doctrine/annotations Version ^1.13
adbario/php-dot-notation Version ^3.1
ext-bcmath Version *
moneyphp/money Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package autoprotect-group/php-dynamodb-odm contains the following files

Loading the files please wait ....