framework/gii/CCodeGenerator.php
protected function prepare()
	{
		if($this->codeModel===null)
			throw new CException(get_class($this).'.codeModel property must be specified.');
		$modelClass=Yii::import($this->codeModel,true);
		$model=new $modelClass;
		$model->loadStickyAttributes();
		if(isset($_POST[$modelClass]))
		{
			$model->attributes=$_POST[$modelClass];
			$model->status=CCodeModel::STATUS_PREVIEW;
			if($model->validate())
			{
				$model->saveStickyAttributes();
				$model->prepare();
			}
		}
		return $model;
	}
protected function prepare()
	{
		if($this->codeModel===null)
			throw new CException(get_class($this).'.codeModel property must be specified.');
		$modelClass=Yii::import($this->codeModel,true);
		$model=new $modelClass;
		$model->loadStickyAttributes();
		if(isset($_POST[$modelClass]))
		{
			$model->attributes=$_POST[$modelClass];
			$model->status=CCodeModel::STATUS_PREVIEW;
			if($model->validate())
			{
				$model->saveStickyAttributes();
				$model->prepare();
			}
		}
		return $model;
	}
protected function prepare ( ) { if ( $ this -> codeModel === null ) throw new CException ( get_class ( $ this ) . '.codeModel property must be specified.' ) ; $ modelClass = Yii :: import ( $ this -> codeModel , true ) ; $ model = new $ modelClass ; $ model -> loadStickyAttributes ( ) ; if ( isset ( $ _POST [ $ modelClass ] ) ) { $ model -> attributes = $ _POST [ $ modelClass ] ; $ model -> status = CCodeModel :: STATUS_PREVIEW ; if ( $ model -> validate ( ) ) { $ model -> saveStickyAttributes ( ) ; $ model -> prepare ( ) ; } } return $ model ; }
Prepares the code model.
Prepares the code model .