PHP code example of calderawp / data-source

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

    

calderawp / data-source example snippets


use calderawp\DB\Factory;
use calderawp\interop\Attribute;
calderawp\interop\Collections\Attributes;

$tableName = 'cf_whatever';
$primaryKey = 'id';
$indexes = ['name'];

$tableSchema = $factory->tableSchema([], $tableName, $primaryKey, $indexes);