Subclassing DbCommand

How would I subclass DbCommand? I understand how to do driver specific subclasses of the classes in Schema but it is not clear how to do the same for the core DB classes.

In particular I want to override execute() so that if


$n=$this->_statement->rowCount();

returns a single row I can retrieve it.

The background to this is that I’m working on enhancing the Firebird driver to work with gii.

Firebird supports this syntax:


insert into table(fields) values (values) returning pkname

but the only way to get the value is to read the result set after executing the insert statement.

The value would get assigned to a member field of CFirebirdCommandBuilder where it could then be retrieved via a Firebird specific call to getLastInsertID.

Zoggo, hi, do you have some news about the firebird adaptor? I would love to use it, have all my projects in delphi with firebird and can’t use yii to extend those.

Sorry for my English

Read this.

I extended CDbConnection in order to change a function in CDCommand, nearly the same you have to do (just change another function).

You can find the file ZDbConnection for download, here you will find the right inspiration.

Yes, I’ve been working on it. I’m hoping (read - will ) find time this week to upload the enhancements and document the problems I had with the idle sign code.

I had a hd failure and other work to do, otherwise I would have posted already.