Skip to content

Releases: atk4/data

0.4 - Implement Table Joins

28 Jun 16:34
Compare
Choose a tag to compare

Table join is a new significant release that allows you to define models that span across multiple tables.

$j_c = $user->join('contact');
$j_c->addField('phone');

Additional changes in this release are:

  • added hook beforeModify, afterModify
  • added Model::delete()
  • added hook beforeDeleteQuery, initSelectQuery, beforeUpdateQuery.
  • added some practical tests (smbo)

0.3 - General improvements, hooks

28 Jun 16:24
Compare
Choose a tag to compare

This release delivers various improvements to Agile Data

  • added Model::addFields() that can add multiple fields
  • added Model::tryLoad()
  • added Model::insert()
  • added Persistence::connect() as a factory method
  • implemeted model-related hooks
  • You can now var_dump(field) safely
  • specify optional table to persistence layer's method (array)
  • integrate colorful exception into test-suite
  • added setDB() getDB() wrappers for managing db state in test-suite
  • added class Structure as a local extension for DSQL, for creating tables

0.2 - Implement Models and Persistence

27 Jun 01:09
Compare
Choose a tag to compare

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

0.1 - Initial release (does nothing yet)

11 May 11:48
Compare
Choose a tag to compare