Tag Archives: Doctrine

Doctrine Query Foreach Problem

The other day I was trying foreach loop through a Doctrine collection. I was getting confused, because my loop was never executing even though count() returned a positive value. It turns out that I had forgotten to run ->execute() on … Continue reading

Posted in 1.4, Doctrine, PHP, Symfony | Tagged , | Leave a comment

Doctrine Wherein with Empty Array

Today I was working with some doctrine code and was running into a strange bug. I was running a query that should have returned no objects, but instead returned all objects from a table. It turns out it was due … Continue reading

Posted in 1.4, Doctrine, Symfony | Tagged , , , , , | Leave a comment

Symfony 1.4: Doctrine DQL Doesn’t Like Double Quotes

There are a number of problems that can cause this Doctrine error: One of them relates to using double quotes in a DQL statement. For example, the following will cause the aforementioned error: In that case Doctrine interprets myfile to … Continue reading

Posted in 1.4, Symfony | Tagged , , , | 3 Comments

Symfony with Doctrine: Multiple Unique Columns

If you’ve used Symfony, you have probably used the unique parameter for one of your columns in schema.yml to enforce unique values.  Doctrine creates a unique-type index for that column. But what if you need two columns in the index? … Continue reading

Posted in 1.4, Symfony | Tagged , , , | 1 Comment

Symfony and Saving Serialized Objects

Doctrine has a nice feature that allows users to save objects to a database. However, when using the “object” type in symfony, I discovered an annoying quirk; when updating a record with a serialized object, symfony does not update the … Continue reading

Posted in Symfony | Tagged , , | Leave a comment

Symfony/Doctrine and Setters

Apparently when using Symfony 1.4 with Doctrine, you can’t simply override the setters the way most programmers are use to.  The following code example will cause infinite recursion if placed inside a class that extends sfDoctrineRecord: Instead you have to … Continue reading

Posted in Symfony | Tagged , , , | 2 Comments