moved magic methods

Fix for the issue - https://github.com/yiisoft/yii2/issues/2290.