严格的标准:声明::postDispatch()
我想用 zf 1.11 配置 Doctrine 2.2。一切都完成了,但我不知道这个错误是关于什么的:
严格标准:Sc\Resource\EntityManagerFront::postDispatch() 的声明应与 D:\xampp\htdocs\sc\library\Sc\Resource\EntityManagerFront.php 中的 Zend_Controller_Plugin_Abstract::postDispatch() 的声明兼容第26行
严格标准: Sc\Resource\EntityManagerFront::postDispatch() 的声明应与 D:\xampp\htdocs\sc\library\Sc\Resource\ EntityManagerFront.php 代码:
<?php
namespace Sc\Resource;
use Zend_Controller_Plugin_Abstract, Zend_Controller_Front;
class EntityManagerFront extends Zend_Controller_Plugin_Abstract
{
/**
* Flush the EntityManager.
*
* (non-PHPdoc)
* @see Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
*/
public function postDispatch($request)
{
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$em = $bootstrap->getResource('EntityManager');
$em->flush();
return $em;
}
}
I want to configure Doctrine 2.2 with zf 1.11. Everything is done, but I dont know what this error is about:
Strict standards: Declaration of Sc\Resource\EntityManagerFront::postDispatch() should be compatible with that of Zend_Controller_Plugin_Abstract::postDispatch() in D:\xampp\htdocs\sc\library\Sc\Resource\EntityManagerFront.php on line 26
My code:
<?php
namespace Sc\Resource;
use Zend_Controller_Plugin_Abstract, Zend_Controller_Front;
class EntityManagerFront extends Zend_Controller_Plugin_Abstract
{
/**
* Flush the EntityManager.
*
* (non-PHPdoc)
* @see Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
*/
public function postDispatch($request)
{
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$em = $bootstrap->getResource('EntityManager');
$em->flush();
return $em;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
postDispatch 函数的签名是
所以你必须指定
$request
参数类型:Zend_Controller_Request_Abstract
The signature of postDispatch function is
So you have to specify the
$request
parameter type:Zend_Controller_Request_Abstract
最终固定解决方案:
final fixed solution :