yii2tech\admin\actions\Create::newModel PHP 메소드

newModel() 공개 메소드

Creates new model instance.
public newModel ( ) : yii\db\ActiveRecordInterface | Model
리턴 yii\db\ActiveRecordInterface | yii\base\Model new model instance.
    public function newModel()
    {
        if ($this->newModel !== null) {
            return call_user_func($this->newModel, $this);
        } elseif ($this->controller->hasMethod('newModel')) {
            return call_user_func([$this->controller, 'newModel'], $this);
        } else {
            throw new InvalidConfigException('Either "' . get_class($this) . '::newModel" must be set or controller must declare method "newModel()".');
        }
    }