setFrom doesn't set keys
| From: | Joe Stump | Date: | Thu, 05 Feb 2004 15:30:25 +0000 |
| Subject: | setFrom doesn't set keys | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-25516@lists.php.net to get a copy of this message | ||
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