Symfony2 Doctrine DBAL Wrapper Issue

时间:2013-06-05 10:56:12

标签: php symfony doctrine dbal

我正在尝试为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;
    }
}

任何想法?

1 个答案:

答案 0 :(得分:1)

我设法在这里找到问题 - 这是文件名。我的文件名是Conection.php,但将其更改为ExtendedConnection.php有效。