PHP code example of matasarei / rumble

1. Go to this page and download the library: Download matasarei/rumble 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/ */

    

matasarei / rumble example snippets



// migrations/CreateAppRecordsTable.php

use Matasar\Bundle\Rumble\Migration;

class CreateAppRecordsTable extends Migration
{
    public function up()
    {
        $table = $this->table('test_table'); // table name.
        $table->addAttribue('test_field', 'S'); // primary key data type - String (S)
        $table->addHash('test_field');
        $table->setWCU(1); // Write Capacity Unit (Provisioned write throughput)
        $table->setRCU(1); // Read Capacity Unit (Provisioned read throughput)
        $table->create();
    }
}

// seeds/CreateAppRecordsTable.php

use Matasar\Bundle\Rumble\Seeder;

class AppRecordsTableSeeder extends Seeder 
{
    public function seed()
    {
        $table = $this->table('test_table');
        $table->addItem(['test_field' => 'First record']);
        $table->addItem(['test_field' => 'Second record']); 
        $table->save();
    }