Update ModelCode.php

Fix for ISSUE#1323
https://github.com/yiisoft/yii/issues/1323