Correct way to set the driverOptions for Doctrine DBAL configuration in symfony2

Posted by yesIcan on Stack Overflow See other posts from Stack Overflow or by yesIcan
Published on 2012-11-08T22:15:22Z Indexed on 2012/11/08 23:00 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

I have set driverOptions in the config file as mentioned in the doctrine DBAL documentation.

But this gives and error

1/1 InvalidConfigurationException: Unrecognized options "driverOptions" under "doctrine.dbal.connections.pdoDevCon"

My config file is

dbal:
  default_connection: pdoDevCon
  connections:
    pdoDevCon:
      driver:   %dev_database_driver%    # <
      host:     %dev_database_host%      # |
      port:     %dev_database_port%      # | Defined in
      user:     %dev_database_user%      # |
      password: %dev_database_password%  # <   
      charset:  UTF8
      driverOptions: {3: 2}
      mapping_types:
        enum: string
        set: string

orm:
    auto_generate_proxy_classes: %kernel.debug%
     pdoDevCon:
        connection: pdoDevCon
        mappings:
          AcmeDemoBundle: ~
          AcmeHelloBundle: ~ 

I am using PDO::ATTR_ERRMODE as 3 PDO::ERRMODE_EXCEPTION as 2, it does not work even if i use the strings.

© Stack Overflow or respective owner

Related posts about php

Related posts about symfony2