1. Go to this page and download the library: Download thedomeffm/sapphire library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
thedomeffm / sapphire example snippets
use Symfony\Component\Uid\UuidV4;
use TheDomeFfm\Sapphire\Attribute\DynamoClass;
use TheDomeFfm\Sapphire\Attribute\DynamoField;
#[DynamoClass('products')]
class Product
{
#[DynamoField]
private ?string $id;
#[DynamoField]
private ?string $name;
#[DynamoField]
private ?float $price;
public function __construct() {
$this->id = (string) UuidV4::v4();
}
}
// ...
$product = new Product();
$product->name = $form['name'];
$product->prive = $form['price'];
$dm = new DynamoManager();
$putItem = $dm->preparePutAction($product);
$dynamoDbClient->putItem($putItem);