fixed :

final solution :

<?php

namespace Sc\Resource;

use Zend_Controller_Plugin_Abstract,
    Zend_Controller_Front,
        Zend_Controller_Request_Http,
        Zend_Controller_Request_Abstract;


class EntityManagerFront extends Zend_Controller_Plugin_Abstract {

    /**
     * Flush the EntityManager.
     *
     * (non-PHPdoc)
     * @see Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
     */
    public function postDispatch(Zend_Controller_Request_Abstract $request)
{

        $bootstrap =
Zend_Controller_Front::getInstance()->getParam('bootstrap');
        $em = $bootstrap->getResource('EntityManager');
        $em->flush();

        return $em;
    }

}

On Mon, Jan 30, 2012 at 9:49 AM, sina miandashti <[email protected]> wrote:

> Catchable fatal error: Argument 1 passed to
> Sc\Resource\EntityManagerFront::postDispatch() must be an instance of
> Sc\Resource\Zend_Controller_Request_Abstract, instance of
> Zend_Controller_Request_Http given, called in
> D:\xampp\htdocs\sc\library\Zend\Controller\Plugin\Broker.php on line 333
> and defined in
> D:\xampp\htdocs\sc\library\Sc\Resource\EntityManagerFront.php on line *18
>
> i got this !
> *
>
> On Mon, Jan 30, 2012 at 12:04 AM, Mickael Perraud <
> [email protected]> wrote:
>
>> Hi,
>>
>> You just have to replace:
>>     public function postDispatch($request)
>> by
>>     public function postDispatch(Zend_Controller_Request_Abstract
>> $request)
>>
>> Regards
>> --
>> Mickaƫl Perraud
>>  Website | http://mikaelkael.fr
>> Twitter | http://twitter.com/mikaelkael
>> PGP key | http://mikaelkael.fr/mikaelkael.asc
>>
>>
>>
>> 2012/1/29 sina miandashti <[email protected]>
>>
>>> i want to configure Doctrine 2.2 with zf 1.11 everything is done ... but
>>> i
>>> dont know what is this error 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 file :
>>>
>>>    <?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;
>>>  }
>>> }
>>>
>>>
>>> --
>>> ________________
>>> Sincerely
>>> Sina Miandashti
>>> www.InTheMix.ir & www.InvisionPower.ir Admin
>>>
>>
>>
>

Reply via email to