Re: DB_DataObject_FormBuilder: how to override processForm() method
| From: | Giorgio Gorla | Date: | Fri, 12 Nov 2004 11:22:28 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder: how to override processForm() method | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15465@lists.php.net to get a copy of this message | ||
Justin Patrin ha scritto:
Sorry, I'm still not seeing what you're referring to. The API docs don't say that you can put a processForm method in your DO....could you give me a link and the approximate location?http://pear.php.net/package/DB_DataObject_FormBuilder/docs/0.10.3/apidoc/DB_DataObject_FormBuilder-0.10.3/DB_DataObject_FormBuilder.html#methodprocessForm
Then what is your problem? What do you mean by a "natural primary key"? Shouldn't this just be one of your fields? If you're setting a special value for a key algorithmically, then you can do it in preProcessForm(). Tell me what your code needs to do (or show me your processForm that you wrote before) and I'll tell you how to do it.I have this table: CREATE TABLE
auth (
username varchar(50) NOT NULL default '',
password varchar(32) NOT NULL default '',
PRIMARY KEY (username),
KEY password (password)
) TYPE=MyISAM;
Within Auth.php (class DB_DataObject_Auth generated by createTable.php) I've set
$fb_hidePrimaryKey = false
in order to input primary key manually.
But when I try to insert a new record, DBOF does an update.
J