Implementation of Battle in yii