src/yii/base/Model.php
protected function loadModel($id = null)
	{
		/** @var BaseActiveRecord $modelClass */
		$modelClass = $this->modelClass();
		if($id) {
			$this->modelInstance = $modelClass::findOne($id);
		} else {
			$this->modelInstance = new $modelClass();
		}
		$this->modelInstance->load($this->attributes, '');
		return $this->modelInstance;
	}
protected function loadModel($id = null)
	{
		/** @var BaseActiveRecord $modelClass */
		$modelClass = $this->modelClass();
		if($id) {
			$this->modelInstance = $modelClass::findOne($id);
		} else {
			$this->modelInstance = new $modelClass();
		}
		$this->modelInstance->load($this->attributes, '');
		return $this->modelInstance;
	}
protected function loadModel ( $ id = null ) { /** @var BaseActiveRecord $modelClass */ $ modelClass = $ this -> modelClass ( ) ; if ( $ id ) { $ this -> modelInstance = $ modelClass :: findOne ( $ id ) ; } else { $ this -> modelInstance = new $ modelClass ( ) ; } $ this -> modelInstance -> load ( $ this -> attributes , '' ) ; return $ this -> modelInstance ; }
load model instance.

@param integer|null $id

@return BaseActiveRecord|null the saved model or null if saving fails
load model instance .