How to use Doctrine OracleSessionInit listener with Symfony2?

前端 未结 3 1637
天涯浪人
天涯浪人 2021-02-07 10:21

I am using oracle and I am recieving this error:

Could not convert database value \"17-NOV-11 12.17.33 AM\" to Doctrine Type datetime. Expected format: Y-

3条回答
  •  梦毁少年i
    2021-02-07 10:45

    Well It appears I will answer myself this time.

    You have to add it as a service using the event tag.

    app/config/config.yml 
    
    services:
        my.listener:
            class: Doctrine\DBAL\Event\Listeners\OracleSessionInit 
            tags:
                - { name: doctrine.event_listener, event: postConnect }
    

    my.listener is an arbitrary name for the listener.

提交回复
热议问题