$tansaction !== null. As i know Yii 2 not using this compare approach.