Re: DB_DataObject_formbuilder sequence

From: Date: Wed, 05 Jan 2005 08:23:17 +0000
Subject: Re: DB_DataObject_formbuilder sequence
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16631@lists.php.net to get a copy of this message
Justin Patrin wrote:
On Wed, 05 Jan 2005 00:35:49 +0530, Jacob Singh <jacob@pajamadesign.com> wrote:
I'm using sequences in application and I want to specify the primary key value before inserting the data using the Formbuilder. Where do i do this. it never seems to set correctly.
If you implemented a sequence all your own you're going to have to look into the sequenceKey() call. I would recommend using a sequence in the DB itself or allowing DB to handle the sequence. Both shoudl work with DB_DataObject. I tried looking into this, but to no avail. I'm using Seagull, and we have a sequence table. Code elsewhere in the framework is something like:
$dbh = $myDO->getDatabaseConnection(); $nextId = $dbh->nextId($tablename); $myDO->primary_key = $nextId; $myDO->otherfield = "foobar"; $myDO->insert(); Is this "in the DB itself" or do I need sequenceKey()? I tried playing around with sequence key, but it's not working. It doesn't set anything. Plus, I guess it would need to be set after FB is called, but before the form object is generated and the process method is called. Is this correct? It doesn't work now. Thanks Jacob
Thanks Jacob


« previous php.pear.general (#16631) next »