Automatic Creation of Models

Models can be created by hand as illustrated in the following sections, however; if your database tables already exist, automatically creating your models based on the existing table is fast and easy. To use this method, you simply use Solar's command line utility script.

For more information, see the following:

The command line script will

  1. create the model class representing your table,
  2. create a _setup() method within that class,
  3. create a class to represent a single record (Solar_Sql_Model_Record),
  4. create a class to represent a collection of records (Solar_Sql_Model_Collection), and
  5. create the _table_name and _table_cols properties referred to in the _setup() method.
 
manual/model/cli.txt · Last modified: 2009/06/05 21:40 by jelofson