Need to reload parent queryScalar() method in case it refer on yii/db/Query object in last return statement instead of static instance. It leads to errors in createCommand next call because you also reload build() method in your QueryBuilder class that has own specific method calls like buildSample(), buildPreWhere(), buildWithTotals().
Need to reload parent queryScalar() method in case it refer on yii/db/Query object in last return statement instead of static instance. It leads to errors in createCommand next call because you also reload build() method in your QueryBuilder class that has own specific method calls like buildSample(), buildPreWhere(), buildWithTotals().