composite key update after insertion


I have table with a composite primary key made of 2 columns : id (auto-incremented) and user_id.

After a successful insertion, I’d like to get the value for id … but in vain :(

From what I saw in the CActiveRecord insert method, an auto-incremented primary key is updated only in the case where it is not part of a composite.


if($table->sequenceName!==null && is_string($primaryKey) && $this->$primaryKey===null)



…so how can I do to get the value of id, just after the call to ?


i just added support to this case.

ok quiang, thanks …