protected function loadModel($id)
    {
        if (empty($this->additionalCriteriaOnLoadModel)) {
            $model = CActiveRecord::model($this->modelName)->findByPk($id);
        } else {
            $finder = CActiveRecord::model($this->modelName);
            $c = new CDbCriteria($this->additionalCriteriaOnLoadModel);
            $c->mergeWith(
                array(
                    'condition' => $finder->tableSchema->primaryKey . '=:id',
                    'params' => array(':id' => $id),
                )
            );
            $model = $finder->find($c);
        }
        if (isset($model)) {
            return $model;
        }
        if ($this->additionalCriteriaOnLoadModel) {
            throw new CHttpException(404, 'Unable to find the requested object.');
        }
    }
protected function loadModel($id)
    {
        if (empty($this->additionalCriteriaOnLoadModel)) {
            $model = CActiveRecord::model($this->modelName)->findByPk($id);
        } else {
            $finder = CActiveRecord::model($this->modelName);
            $c = new CDbCriteria($this->additionalCriteriaOnLoadModel);
            $c->mergeWith(
                array(
                    'condition' => $finder->tableSchema->primaryKey . '=:id',
                    'params' => array(':id' => $id),
                )
            );
            $model = $finder->find($c);
        }
        if (isset($model)) {
            return $model;
        }
        if ($this->additionalCriteriaOnLoadModel) {
            throw new CHttpException(404, 'Unable to find the requested object.');
        }
    }
protected function loadModel ( $ id ) { if ( empty ( $ this -> additionalCriteriaOnLoadModel ) ) { $ model = CActiveRecord :: model ( $ this -> modelName ) -> findByPk ( $ id ) ; } else { $ finder = CActiveRecord :: model ( $ this -> modelName ) ; $ c = new CDbCriteria ( $ this -> additionalCriteriaOnLoadModel ) ; $ c -> mergeWith ( array ( 'condition' => $ finder -> tableSchema -> primaryKey . '=:id' , 'params' => array ( ':id' => $ id ) , ) ) ; $ model = $ finder -> find ( $ c ) ; } if ( isset ( $ model ) ) { return $ model ; } if ( $ this -> additionalCriteriaOnLoadModel ) { throw new CHttpException ( 404 , 'Unable to find the requested object.' ) ; } }
Loads the requested data model.

@param integer $id the model ID

@return CActiveRecord the model instance.
@throws CHttpException if the model cannot be found
Loads the requested data model .