src/Form.php
public function setModel(\atk4\data\Model $model, $fields = null)
    {
        // Model is set for the form and also for the current layout
        try {
            $model = parent::setModel($model);
            $this->layout->setModel($model, $fields);

            return $model;
        } catch (Exception $e) {
            throw $e->addMoreInfo('model', $model);
        }
    }
public function setModel(\atk4\data\Model $model, $fields = null)
    {
        // Model is set for the form and also for the current layout
        try {
            $model = parent::setModel($model);
            $this->layout->setModel($model, $fields);

            return $model;
        } catch (Exception $e) {
            throw $e->addMoreInfo('model', $model);
        }
    }
public function setModel ( \ atk4 \ data \ Model $ model , $ fields = null ) { // Model is set for the form and also for the current layout try { $ model = parent :: setModel ( $ model ) ; $ this -> layout -> setModel ( $ model , $ fields ) ; return $ model ; } catch ( Exception $ e ) { throw $ e -> addMoreInfo ( 'model' , $ model ) ; } }
Associates form with the model but also specifies which of Model
fields should be added automatically.

If $actualFields are not specified, then all "editable" fields
will be added.

@param \atk4\data\Model $model
@param array            $fields

@return \atk4\data\Model
Associates form with the model but also specifies which of Model fields should be added automatically .