Esempio n. 1
0
 public function init()
 {
     parent::init();
     if ($this->getScenario() === self::SCENARIO_UPDATE) {
         $this->_setAttributesByGameModel();
     }
 }
Esempio n. 2
0
 public function setAttributesByPost($postData = array())
 {
     parent::setAttributesByPost($postData);
     if (!$this->gameId) {
         $game = Game::model()->findByAttributes(array('title' => $this->gameTitle));
         if ($game) {
             $this->gameId = $game->id;
         }
     }
 }