0.2 - Implement Models and Persistence
This is the first usable version of Agile Data.
You should be able to define your models:
class Model_User extends \atk4\data\Model {
protected $table = 'user';
function init() {
parent::init();
$this->addField('name');
$this->addField('surname');
}
and then use them:
$m = new Model_User($db);
$m->load(1);
$m['name'] = 'John';
$m->save();
This implementation contains:
- Active Record (array access) implementation
- Driver implementation Array and SQL (on top of DSQL)
- Record field type bi-directional mapping (boolean, date, enum, json)
- Mechanic for tracking field changes (original values, dirty etc)
- Ability to move field from one persistence driver to another