Symfony2 Doctrine bundle constructor, what is the $typesconfig requirement they are asking for?

StackOverflow https://stackoverflow.com/questions/17530278

Pregunta

Hey guys I'm trying to port the ConnectionFactory class from the Symfony2 Doctrine2 bundle back into a stock installation of Doctrine2, but ran across a snag. The constructor requires an initialization array of $typesconfig on line 36. I briefly had a ticket open with FOS here but was told that this had nothing to do with the mime.magic. They did not go on to explain what the $typesconfig variable actually is though or why it is required.

In order to port this, I need to understand what the $typesconfig array is and what it holds, could someone please tell me what is in this constructor variable so I can finish porting this class?

¿Fue útil?

Solución

Dive into the configuration of DoctrineBundle and you will find what you're looking for.

There is a parameter doctrine.dbal.connection_factory.class which holds the ConnectionFactory classname.

This parameter is used to define the service doctrine.dbal.connection which receives the argument %doctrine.dbal.connection_factory.types% - a parameter array aka the typeConfigs.

Now just search your vendor dir for doctrine.dbal.connection_factory.types and you will find:

$container->setParameter('doctrine.dbal.connection_factory.types', $config['types']);

I leave the final step of finding types in DoctrineBundle's configuration reference to you...

tip: it's somewhere around doctrine.dbal.types with a little description :)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top