I have a database field which can be 0 or 1. I simply would like to swap it, I have the native SQL for it:
UPDATE dbo.Table1 SET col2 = col2 ^ 1;
and the Phalcon style:
$query = Phalcon\DI::getDefault()->get('db'); $query->update('Table', array('active'), array('active ^ 1'), array('conditions' => 'id = ?', 'bind' => $userId)))
well it turns 1 to 0 but never 0 to 1. So its a one way direction