Search code examples
objectserializationdqldoctrine-orm

doctrine2 dql query by property of serialized object within entity


I have an entity with an 'object' type column. I want to be able to retreive the entity by a property (say id) of that object. For example, the query would look something like this:

$em->createQuery('SELECT e FROM Entity_Class e SOME_MAGIC e.object o WHERE o.id = ?1');

The question is, is there *SOME_MAGIC* in dql?


Solution

  • This is not possible an object type column is serialized into a CLOB field using serialize(). There is no way to query subproperties of it.