Will you give me an example of a delete query that use a left join using Doctrine?
It's not possible. See that: http://trac.doctrine-project.org/ticket/2142
You have to use a subquery in the where clause: http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language:subqueries
Try something like that:
$q = Doctrine_Query::create()
->delete('TableB b')
->where('b.id NOT IN (SELECT b.id FROM TableB b \
INNER JOIN b.TableA a WHERE b.date > NOW() AND a.channel_id = 10)')
->execute();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With