Most people put the table classes in their models directory.  If your
model is simple enough, you may be able to use the table class itself as
the model.  

Other models may be more complex, requiring access to multiple table,
etc.  For these you'd write a model class (extending nothing) that
utilizes any table classes it needs.

And yes, you do need to write code for the table classes.  They are not
generated.  Perhaps one could write a tool that generates skeleton table
classes.  The simple case is very easy:

  $db = Zend_Db::factory(...);
  foreach ($db->listTables() as $tableName) {
    $fp = fopen("models/$tableName.php", "w");
    fwrite($fp, "class $tableName extends
Zend_Db_Table_Abstract\n{\n}\n");
    fclose($fp);
  }

If not specified, the name of the class is used as the name of the
database table.
If not specified, the primary key is automatically queried from the
database.
Other metadata, like the list of columns, is automatically queried from
the database.
There is no automatic discovery of foreign key references in ZF at this
time (maybe someday).

Regards,
Bill Karwin

> -----Original Message-----
> From: Dan Rossi [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 02, 2007 6:16 PM
> To: Bill Karwin
> Cc: Zend Framework
> Subject: Re: [fw-general] Table DataObjects and Error handling
> 
> So im still unsure how does the table objects work, do these 
> get generated from table schemas or is it manual, also where 
> do they go exactly, into the model directory ?

Reply via email to