2

From: http://agiletoolkit.org/learn/understand/model/add

class Model_MyModel extends Model_Table {

    function init(){
        parent::init();
        $this->addField('name');
    }
}

From: http://agiletoolkit.org/intro/models

class Model_MyModel extends Model_Table {

    function defineFields(){
        parent::defineFields();
        $this->addField('name');
    }
}

Which is correct? What's the difference?

tereško
  • 58,060
  • 25
  • 98
  • 150

1 Answers1

4

Agile Data has been refactored into a separate framework: http://git.io/ad

The up-to-date way for defining the model is documented here: http://agile-data.readthedocs.io/en/develop/model.html


using the init() method is the right one. defineField is old way and was changed in favor of "init" due to consistency.

I will update the pages accordingly.

romaninsh
  • 10,606
  • 4
  • 50
  • 70