【问题标题】:Symfony2 Doctrine DBAL Wrapper IssueSymfony2 Doctrine DBAL Wrapper 问题
【发布时间】:2013-06-01 01:04:22
【问题描述】:

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

有什么想法吗?

【问题讨论】:

    标签: php symfony doctrine dbal


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2011-10-19
      • 2011-09-26
      • 2015-04-19
      • 1970-01-01
      • 1970-01-01
      • 2011-07-15
      • 2014-11-05
      • 1970-01-01
      • 2017-07-20
      相关资源
      最近更新 更多