I'm using Doctrine, a PHP ORM. I have created a Doctrine Query, and I need more control. So I've started to use the ->andWhere(...)
methods to add new where clauses. However I need to do a subquery based on another table, like so:
$query->andWhere("id in (SELECT id from other_table where value = ?)", $myvar);
The above doesn't work. However there is no Doctrine class for other_table, and doctrine keeps trying to load the file other_file.php
. I have figured out that it is interpreting this as DQL (right?). Is there someway I can tell Doctrine to not interpret this as DQL, so that I can just use raw SQL?
I know I could use Doctrine_RawSql
, but that would involve rewriting all of this query. It would be nice if there was a halfway house.