Re: NextID and DB_DataObjects (me too;)
| From: | Alan Knowles | Date: | Fri, 22 Nov 2002 10:13:49 +0000 |
| Subject: | Re: NextID and DB_DataObjects (me too;) | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2809@lists.php.net to get a copy of this message | ||
this was the idea of adding a configuration option:
seq_tablename = DATE-SEQUENCE-INCREMENT
or perhaps
seq_tablename = __IGNORE__ // to tell it not to autocreate sequences...
do you think that would work?
Regards
Alan
LIMBOURG Arnaud wrote:
The only problem with that is when you want to have your own id, like DATE-SEQUENCE-INCREMENT.
You then have no choice but to override insert or do your own piece of code and tell dataobject the id ;)
try changing the line in insert as below..
I guess it should be user defined somehow.. if you can come up with a
patch that does that feel free to commit it.
if (($key = @$keys[0]) && ($dbtype != 'mysql')) {
$this->$key = $__DB->nextId($this->__table.'_seq');
}
Of the top of my head
[DB_DataObject]
seq_tablename = sequencename
may be a good format.. - if it exists use the value,
otherwise use tablename_seq
Regards
Alan
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php