ZF-191: Allow setting primary key values when creating/updating rows
Description
The current implementation of Zend_Db_Table_Row throws an exception when attempting to set the value of the primary key. This is annoying when importing records with pre-existing id's. Suggest that we allow setting the id when it's current value is null.
Comments
Posted by Sami Samhuri (sjs) on 2006-07-18T10:27:19.000+0000
I can't find a way to do this without modifying Zend_Db_Table_Row itself. I'm trying my hardest to not modify things so upgrades are easy. For user-specified varchar PKs this is essential (I'm going to see about changing that, but the schema might be fixed).
(fetchNew could set a flag which causes save to not nullify and check the PK, or something similar)
Posted by Bill Karwin (bkarwin) on 2006-11-13T15:22:38.000+0000
Changing fix version to 0.8.0.
Posted by Bill Karwin (bkarwin) on 2007-01-05T17:06:24.000+0000
Recategorize as Zend_Db_Table component.
Posted by Bill Karwin (bkarwin) on 2007-03-19T16:23:28.000+0000
Update summary.
Posted by Bill Karwin (bkarwin) on 2007-05-03T17:25:27.000+0000
Setting fields in the primary key is now permitted, as of revision 4697.