2

DBAL 接続用のカスタム ラッパーを作成しようとしていますが、config.yml ファイルを正しくセットアップしました。

ただし、次のエラーが発生します。

DBALException: The given 'wrapperClass' Some\Bundle\Doctrine\DBAL\ExtendedConnection 
has to be a subtype of \Doctrine\DBAL\Connection.

しかし、私のクラスは以下を拡張してい\Doctrine\DBAL\Connectionます:

namespace Some\Bundle\Doctrine\DBAL\ExtendedConnection;

use Doctrine\DBAL\Connection AS Connection;

class ExtendedConnection extends Connection
{
    public function multipleResultSetsFetchAll()
    {
        $stmt = $this->getConnection();
        do{
            $results[] = $stmt->fetchAll();
        }while($stmt->nextRowset());

        return $results;
    }
}

何か案は?

4

1 に答える 1

1

ここで問題を見つけることができました-それはファイル名でした。私のファイル名は Conection.php でしたが、それを ExtendedConnection.php に変更するとうまくいきました。

于 2013-06-05T12:30:11.603 に答える