public function init() { parent::init(); if ($this->getScenario() === self::SCENARIO_UPDATE) { $this->_setAttributesByGameModel(); } }
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; } } }