On Jun 1, 2010, at 12:36 AM, Steve Rayner wrote:
Zend_Db_Table encourages us to use a field name of id for the primary key for each table (i know we can override it).
If you don't declare the $_primary attribute of your Table class, Zend_Db_Table defaults to the column (or columns) declared as the primary key in your database. It queries the table metadata when you instantiate the Table object. If it still can't find a primary key, it throws an exception. There is no default of "id" or any other name.
Anyway, I'm glad you found that renaming your primary key columns resolved the ambiguity.
Regards,
Bill Karwin
没有评论:
发表评论