I’m trying to build this SQL query:
update shop_product set flags=flags^(flags&1024);
Using Doctrine 1.2.
I have tried these methods:
Doctrine_Query::create()
->update('Model_ShopProduct p')
->set('p.flags', 'p.flags^(p.flags&' . $flag);
also:
Doctrine_Query::create()
->update('Model_ShopProduct p')
->set('p.flags', new Doctrine_Expression('p.flags^(p.flags&?'), $flag);
And many similar variations with no success. Please help mi with this one.
The simpliest way to achieve this is to salvage database connection from
Doctrineand perfrom raw sql query on it, something likeIf you are not familiar with PDO, here is the documentation on
PDO::query.