Skip to content

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 cont…

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&#82…

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