ZF-191: Allow setting primary key values when creating/updating rows

Issue Type: Improvement Created: 2006-07-03T19:32:23.000+0000 Last Updated: 2007-07-05T14:43:12.000+0000 Status: Resolved Fix version(s): - 0.9.3 (05/May/07)

Reporter: Art Hundiak (cerad) Assignee: Bill Karwin (bkarwin) Tags: - Zend_Db_Table

Related issues: - ZF-1144



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.


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.