PHP code example of frozensheep / synthesize
1. Go to this page and download the library: Download frozensheep/synthesize 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/ */
frozensheep / synthesize example snippets
use Frozensheep\Synthesize\Synthesizer;
class Transaction {
use Synthesizer;
protected $arrSynthesize = array(
'amount' => array('type' => 'float'),
'description' => array('type' => 'string', 'default' => 'Super cool product.')
};
}
$objTransaction = new Transaction();
$objTransaction->amount = 19.95;
$objTransaction->description = '4x Large Bowls';