[英]Symfony2 Doctrine DBAL Wrapper Issue
I am trying to create a custom wrapper for a DBAL connection and have correctly setup the config.yml file, 我正在尝试为DBAL连接创建自定义包装,并正确设置了config.yml文件,
however I am getting the following error: 但是我收到以下错误:
DBALException: The given 'wrapperClass' Some\Bundle\Doctrine\DBAL\ExtendedConnection
has to be a subtype of \Doctrine\DBAL\Connection.
However my class is extending the \\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;
}
}
Any Ideas? 有任何想法吗?
I managed to find the problem here - it was the filename. 我设法在这里找到问题-它是文件名。 My file name was Conection.php but changing it to ExtendedConnection.php worked.
我的文件名为Conection.php,但将其更改为ExtendedConnection.php可以。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.