Re: setFrom doesn't set keys
| From: | Alan Knowles | Date: | Thu, 05 Feb 2004 15:31:22 +0000 |
| Subject: | Re: setFrom doesn't set keys | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25517@lists.php.net to get a copy of this message | ||
if it's not an autoincrement/sequenced table - just define a method
function sequenceKey() {
return array(false,false,false);
}
Regards
Alan
Joe Stump wrote:
I know this may be expected behavior if you fech() a row, update it with setFrom() and then do an update(), but what if your empty is brand new. Example: $do = & DB_DataObject::factory('table'); $do->setFrom($_POST); // yes this is bad, bear with me. if($do->insert()) { echo 'SUCCESS!'; } DBDO currently ignores keys completely in setFrom. I think a better behavior would be for DBDO to know that the key is empty and go ahead and populate the data (for inserts). Am I way off base here? --Joe -- Joe Stump, President JCS Solutions http://www.jcssolutions.com (734) 786 0176-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com