Models

  1. Adroit Models represent an entry in the database, and map directly to a table. They rely on naming conventions both for the table name, and the column names.
  2. BUILD SCRIPTS
    Several build scripts exist to quickly and effortlessly create Model classes
    >php buildmodel Contact would build a new Model, Contact, in app/model/Contact.model.php. The model class produce will be empty of any attributes (aside from 'id' and 'created' which are inherited from BaseModel). Attributes corresponding to your Model can simply be inserted into the new class as public properties.
    >php buildtable Contact will build a table in the database for the Contact model, creating any columns you have added as attributes to the class. If at any time you need to add additional attributes to your model, you can run this script again and it will synch your table by adding any new columns that are needed. It will not remove columns from the table though that do not exist in the Model. Make sure that the database configuration is setup in adroit.conf.php.
more on Models...