RE: [PEAR] NextID and DB_DataObjects (me too;)
| From: | LIMBOURG Arnaud | Date: | Tue, 19 Nov 2002 16:30:49 +0000 |
| Subject: | RE: [PEAR] NextID and DB_DataObjects (me too;) | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2761@lists.php.net to get a copy of this message | ||
If it can help here is what i did
function insert($userid)
{
$id = $this->newID($userid);
$this->prj_id = $id;
parent::insert();
$this->prj_id = $id; // reinitialistation de l'identifiant
} // end func insert
function newID($userid)
{
$this->_connect();
$connections =
&PEAR::getStaticProperty('DB_DataObject','connections');
$__DB = &$connections[$this->_database_dsn_md5];
$prefix = date('Y-m-d');
$increment = $__DB->nextId('projet');
return $prefix . '-' . $userid . '-' . $increment;
} // end func newID
> Hello,
>
> I got this error with DataObjects Insert method :
> Warning: Missing argument 1 for nextid() in
> /usr/share/pear/DB/pgsql.php
> on line 492
>
> The database is Postgresql and DataObjects doesn't use the sequences
> defined in the DB.
> The DataObjects insert() method calls DB->nextId() without
> parameters,
> it is very strange as it normally takes one or two.
>
> Does someone have the same problem or knows a workaround ???
>
> Thanks in advance
>
> Gregory
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>