Skip to content
Advertisement

Tag: doctrine-orm

ZF2 Doctrine2 repository result as array

I have the problem, that I have two controllers. One is a restful controller which only handles json data and returns a JsonModel, and the other one is a default controller which returns a ViewModel Now I have the problem, that my method only returns an array of entities, which is correct for the default controller, but my restful controller

How to get Doctrine to log queries in Symfony2

I’m pretty new to Symfony2, and I’m looking for a way to log SQL queries (including timings) to the same log file as the rest of my application. From what I can determine from the documentation this should all work out of the box, but after a few hours of trying I can’t figure out what I’m doing wrong. config_dev.yml

Doctrine : Default value on joinColumn field

New to symfony2 and Doctrine. How can I set a default value to the field foo_id (which is a reference on Foo table) to point on the ID 1 of the Foo table (which exists in all cases) ? I tried a lot of things without success : Set default value to ID 1 in the constructor of Foo Perform

Access Command OutputInterface within a Doctrine Fixtures Load

I’m generating a huge amount of data fixtures using the awesome Faker Library, also using lorempixel.com to have some random images in my Symfony2 project. This takes some time (currently ~ 10 Minutes), so I was wondering if it is possible to access the Command OutputInterface somehow through the container interface and print the progress this way instead of echo’ing

How to use Master/Slave doctrine2 configurations from Symfony2 Console commands

I’m using the Doctrine2 master/slave configuration in Symfony2 to scale my application across a single master database and several read-only (replicated) slaves. This works perfectly from within my application and Doctrine2 sensibly uses the slave for read-only queries and the master for write operations. If in one of my controllers, I wrote: isConnectedToMaster() returns false – which I would expect

Advertisement