frozensheep / synthesize
Synthesizer trait 用于自动生成对象的getter和setter访问器。
1.0
2015-12-07 14:11 UTC
Requires
- php: >=5.4
- myclabs/php-enum: 1.*
This package is not auto-updated.
Last update: 2024-09-14 18:36:44 UTC
README
Synthesizer trait 用于自动生成对象的getter和setter访问器。
安装
使用Composer安装
composer require frozensheep/synthesize
用法
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';