yii2tech\admin\actions\Create::newModel PHP Method

newModel() public method

Creates new model instance.
public newModel ( ) : yii\db\ActiveRecordInterface | Model
return 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()".');
        }
    }