I am having a little trouble getting a query to work:
$owner->updateAll(
[$attribute => new Expression($db->quoteColumnName($attribute) . sprintf('%+d', $delta))],
['and', $attribute . ' >= :key', $this->rootAttribute . ' = :root'],
[':key' => $key, ':root' => $owner->{$this->rootAttribute}]
);
The problem is that $attribute is in fact the word "left" which is a reserved word in MySQL, of course, so the query fails. It in fact creates:
UPDATE `tbl_geozone` SET `left`=`left`+2 WHERE (left >= '170') AND (root = '1')
The docs seem unclear on how I can take advantage of Yii2 quoting on this query, how can I?