All lines below here are copy&paste from `yii/db/ActiveQuery` and `yii/db/Query`. Would be cool if we could refactor this somehow. not sure how. traits might be cool here :)