FormController

Adds features for working with backend forms. This behavior will inject CRUD actions to the controller -- including create, update and preview -- along with some relevant AJAX handlers.

 class Backend\Behaviors\FormController
extends Backend\Classes\ControllerBehavior

Each action supports a custom context code, allowing fields to be displayed or hidden on a contextual basis, as specified by the form field definitions or some other custom logic.

This behavior is implemented in the controller like so:

public $implement = [
    \Backend\Behaviors\FormController::class,
];

public $formConfig = 'config_form.yaml';

The $formConfig property makes reference to the form configuration values as either a YAML file, located in the controller view directory, or directly as a PHP array.

Traits

Trait Description
AssetMaker

Asset Maker Trait Adds asset based methods to a class

ConfigMaker

Config Maker Trait Adds configuration based methods to a class

ExtensionTrait

Extension trait

FormModelSaver

Implements special logic for processing form data, typically from from postback, and filling the model attributes and attributes of any related models. This is a customized, safer and simplified version of $model->push().

SessionMaker

Session Maker Trait

ViewMaker

View Maker Trait Adds view based methods to a class

WidgetMaker

Widget Maker Trait

Constants

Constant Description
CONTEXT_CREATE
string "create"

Default context for "create" pages.

CONTEXT_PREVIEW
string "preview"

Default context for "preview" pages.

CONTEXT_UPDATE
string "update"

Default context for "update" pages.

Properties

public $formConfig : mixed

Configuration for this behaviour

protected $actions : array

Visible actions in context of the controller

protected $context : string

The context to pass to the form widget.

protected $controller : Backend\Classes\Controller | FormController

Reference to the back end controller.

protected $formWidget : Backend\Widgets\Form

Reference to the widget object.

protected $model : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model

The initialized model used by the form.

protected $requiredConfig : array

Configuration values that must exist when applying the primary config file.

  • modelClass: Class name for the model
  • form: Form field definitions

public $assetPath : string

Inherited from ControllerBehavior

Specifies a path to the asset directory.

public static $extendableStaticCalledClass : string

Inherited from ControllerBehavior

The calling class when using a static method.

public $layout : string

Inherited from ControllerBehavior

Layout to use for the view.

public $suppressLayout : bool

Inherited from ControllerBehavior

Prevents the use of a layout.

public $vars : array

Inherited from ControllerBehavior

A list of variables to pass to the page.

protected $assets : array

Inherited from ControllerBehavior

Collection of assets to display in the layout.

protected $config : array

Inherited from ControllerBehavior

Supplied configuration.

protected $configPath : string

Inherited from ControllerBehavior

Specifies a path to the config directory.

protected static $extensionCallbacks : array

Inherited from ControllerBehavior

Used to extend the constructor of an extension class. Eg:

BehaviorClass::extend(function($obj) { })

protected $extensionHidden : mixed

Inherited from ControllerBehavior

protected $layoutPath : string

Inherited from ControllerBehavior

Specifies a path to the layout directory.

protected $modelsToSave : array

Inherited from FormModelSaver

List of prepared models that require saving.

protected $requiredProperties : array

Inherited from ControllerBehavior

Properties that must exist in the controller using this behavior.

protected $viewPath : string | array

Inherited from ControllerBehavior

Specifies a path to the views directory.

Methods

public __construct (Backend\Classes\Controller $controller)

Behavior constructor

Parameters
Property Description
$controller
Returns
mixed

public create (string $context = null) : void

Controller "create" action used for creating new model records.

Parameters
Property Description
$context
string

Form context

Returns
void

public create_onSave (string $context = null) : Illuminate\Http\RedirectResponse | void

AJAX handler "onSave" called from the create action and primarily used for creating new records.

This handler will invoke the unique controller overrides formBeforeCreate and formAfterCreate.

Parameters
Property Description
$context
string

Form context

Returns
Illuminate\Http\RedirectResponse | void

public static extendFormFields (callable $callback) : void

Static helper for extending form fields.

Parameters
Property Description
$callback
callable
Returns
void

public formAfterCreate ($model)

Called after the creation form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formAfterDelete ($model)

Called after the form model is deleted.

Parameters
Property Description
$model
mixed
Returns
mixed

public formAfterSave ($model)

Called after the creation or updating form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formAfterUpdate ($model)

Called after the updating form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formBeforeCreate ($model)

Called before the creation form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formBeforeSave ($model)

Called before the creation or updating form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formBeforeUpdate ($model)

Called before the updating form is saved.

Parameters
Property Description
$model
mixed
Returns
mixed

public formCreateModelObject () : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model

Creates a new instance of a form model. This logic can be changed by overriding it in the controller.

Returns

public formExtendFields (Backend\Widgets\Form $host, array $fields) : void

Called after the form fields are defined.

Parameters
Property Description
$host

The hosting form widget

$fields
array

Array of all defined form field objects (\Backend\Classes\FormField)

Returns
void

public formExtendFieldsBefore (Backend\Widgets\Form $host) : void

Called before the form fields are defined.

Parameters
Property Description
$host

The hosting form widget

Returns
void

public formExtendModel (Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model $model) : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model | void

Extend supplied model used by create and update actions, the model can be altered by overriding it in the controller.

Parameters
Returns

public formExtendQuery (Winter\Storm\Database\Builder | Winter\Storm\Halcyon\Builder $query) : void

Extend the query used for finding the form model. Extra conditions can be applied to the query, for example, $query->withTrashed();

Parameters
Returns
void

public formExtendRefreshData (Backend\Widgets\Form $host, array $saveData) : array | void

Called before the form is refreshed, should return an array of additional save data.

Parameters
Property Description
$host

The hosting form widget

$saveData
array

Current save data

Returns
array | void

public formExtendRefreshFields (Backend\Widgets\Form $host, array $fields) : array | void

Called when the form is refreshed, giving the opportunity to modify the form fields.

Parameters
Property Description
$host

The hosting form widget

$fields
array

Current form fields

Returns
array | void

public formExtendRefreshResults (Backend\Widgets\Form $host, array $result) : array | void

Called after the form is refreshed, should return an array of additional result parameters.

Parameters
Property Description
$host

The hosting form widget

$result
array

Current result parameters.

Returns
array | void

public formFindModelObject (string $recordId) : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model

Finds a Model record by its primary identifier, used by update actions. This logic can be changed by overriding it in the controller.

Parameters
Property Description
$recordId
string
Returns

public formGetContext () : string

Returns the active form context, either obtained from the postback variable called form_context or detected from the configuration, or routing parameters.

Returns
string

public formGetId (string $suffix = null) : string

Returns a unique ID for the form widget used by this behavior.

This is useful for dealing with identifiers in the markup.

<div id="<?= $this->formGetId()">...</div>

A suffix may be used passed as the first argument to reuse the identifier in other areas.

<button id="<?= $this->formGetId('button')">...</button>
Parameters
Property Description
$suffix
string
Returns
string

public formGetModel () : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model

Returns the model initialized by this form behavior.

The model will be provided by one of the page actions or AJAX handlers via the initForm method.

Returns

public formGetRedirectUrl (string $context = null, Model $model = null) : string

Returns a redirect URL from the config based on supplied context.

Otherwise the default redirect is used. Relative URLs are treated as backend URLs.

Parameters
Property Description
$context
string

Redirect context, eg: create, update, delete.

$model
Model

The active model.

Returns
string

public formGetSessionKey () : string

Helper to get the form session key.

Returns
string

public formGetWidget () : Backend\Widgets\Form

Returns the form widget used by this behavior.

Returns

public formHasOutsideFields () : bool

View helper to check if a form tab has fields in the non-tabbed section (outside fields).

formHasOutsideFields()): ?>
<!-- Do something -->
Returns
bool

public formHasPrimaryTabs () : bool

View helper to check if a form tab has fields in the primary tab section.

formHasPrimaryTabs()): ?>
<!-- Do something -->
Returns
bool

public formHasSecondaryTabs () : bool

View helper to check if a form tab has fields in the secondary tab section.

formHasSecondaryTabs()): ?>
<!-- Do something -->
Returns
bool

public formRender (array $options = []) : string

Method to render the prepared form markup. This method is usually called from a view file.

= $this->formRender() ?>

The first argument supports an array of render options. The supported options can be found via the render method of the Form widget class.

<?= $this->formRender(['preview' => true, section' => 'primary']) ?>
Parameters
Property Description
$options
array

Render options

Returns
string

Rendered HTML for the form.

public formRenderField (string $name, array $options = []) : string

View helper to render a single form field.

= $this->formRenderField('field_name') ?>
Parameters
Property Description
$name
string

Field name

$options
array

(e.g. ['useContainer'=>false])

Returns
string

HTML markup

public formRenderOutsideFields () : string

View helper to render the form fields belonging to the non-tabbed section (outside form fields).

= $this->formRenderOutsideFields() ?>
Returns
string

HTML markup

public formRenderPreview () : string

View helper to render the form in preview mode.

= $this->formRenderPreview() ?>
Returns
string

The form HTML markup.

public formRenderPrimaryTabs () : string

View helper to render the form fields belonging to the primary tabs section.

= $this->formRenderPrimaryTabs() ?>
Returns
string

HTML markup

public formRenderSecondaryTabs () : string

View helper to render the form fields belonging to the secondary tabs section.

= $this->formRenderSecondaryTabs() ?>
Returns
string

HTML markup

public initForm (Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model $model, string $context = null) : void

Initialize the form configuration against a model and context value.

This will process the configuration found in the $formConfig property and prepare the Form widget, which is the underlying tool used for actually rendering the form. The model used by this form is passed to this behavior via this method as the first argument.

Parameters
Property Description
$model
$context
string

Form context

Returns
void

public makeRedirect (string $context = null, Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model $model = null) : Illuminate\Http\RedirectResponse

Returns a Redirect object based on supplied context and parses the model primary key.

Parameters
Property Description
$context
string

Redirect context, eg: create, update, delete

$model

The active model to parse in it's ID and attributes.

Returns
Illuminate\Http\RedirectResponse

public preview (int $recordId = null, string $context = null) : void

Controller "preview" action used for viewing existing model records.

This action takes a record identifier (primary key of the model) to locate the record used for sourcing the existing preview data.

Parameters
Property Description
$recordId
int

Record identifier

$context
string

Form context

Returns
void

public update (int $recordId = null, string $context = null) : void

Controller "update" action used for updating existing model records.

This action takes a record identifier (primary key of the model) to locate the record used for sourcing the existing form values.

Parameters
Property Description
$recordId
int

Record identifier

$context
string

Form context

Returns
void

public update_onDelete (int $recordId = null) : Illuminate\Http\RedirectResponse | void

AJAX handler "onDelete" called from the update action and used for deleting existing records.

This handler will invoke the unique controller override formAfterDelete.

Parameters
Property Description
$recordId
int

Record identifier

Returns
Illuminate\Http\RedirectResponse | void

public update_onSave (int $recordId = null, string $context = null) : Illuminate\Http\RedirectResponse | void

AJAX handler "onSave" called from the update action and primarily used for updating existing records.

This handler will invoke the unique controller overrides formBeforeUpdate and formAfterUpdate.

Parameters
Property Description
$recordId
int

Record identifier

$context
string

Form context

Returns
Illuminate\Http\RedirectResponse | void

protected createModel () : Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model

Internal method used to prepare the form model object.

Returns

protected getLang (string $name, string $default = null, array $extras = []) : string

Parses in some default variables to a language string defined in config.

Parameters
Property Description
$name
string

Configuration property containing the language string

$default
string

A default language string to use if the config is not found

$extras
array

Any extra params to include in the language string variables

Returns
string

The translated string.

protected prepareVars (Winter\Storm\Database\Model | Winter\Storm\Halcyon\Model $model)

Prepares commonly used view data.

Parameters
Returns
mixed

public addCss (array | string $name, array $attributes = []) : void

Inherited from ControllerBehavior

Adds StyleSheet asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
array | string

Specifies a path (URL) or an array of paths to the stylesheet(s).

$attributes
array

Adds extra HTML attributes to the asset link.

Returns
void

public addJs (array | string $name, array $attributes = []) : void

Inherited from ControllerBehavior

Adds JavaScript asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
array | string

Specifies a path (URL) or an array of paths to the script(s).

$attributes
array

Adds extra HTML attributes to the asset link.

Returns
void

public addRss (string $name, array $attributes = []) : void

Inherited from ControllerBehavior

Adds an RSS link asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
string

Specifies a path (URL) to the RSS channel

$attributes
array

Adds extra HTML attributes to the asset link.

Returns
void

public addViewPath (string | array $path) : void

Inherited from ControllerBehavior

Prepends a path on the available view path locations.

Parameters
Property Description
$path
string | array
Returns
void

public combineAssets (array $assets, string $localPath = "") : string

Inherited from ControllerBehavior

Run the provided assets through the Asset Combiner

Parameters
Property Description
$assets
array

Collection of assets

$localPath
string

Prefix all assets with this path (optional)

Returns
string

public static extend (callable $callback)

Inherited from ControllerBehavior
Parameters
Property Description
$callback
callable
Returns
mixed

public extensionApplyInitCallbacks ()

Inherited from ControllerBehavior
Returns
mixed

public static extensionExtendCallback (callable $callback) : void

Inherited from ControllerBehavior

Helper method for ::extend() static method

Parameters
Property Description
$callback
callable
Returns
void

public extensionIsHiddenField ($name)

Inherited from ControllerBehavior
Parameters
Property Description
$name
mixed
Returns
mixed

public extensionIsHiddenMethod ($name)

Inherited from ControllerBehavior
Parameters
Property Description
$name
mixed
Returns
mixed

public flushAssets () : void

Inherited from ControllerBehavior

Disables the use, and subequent broadcast, of assets. This is useful to call during an AJAX request to speed things up. This method works by specifically targeting the hasAssetsDefined method.

Returns
void

public getAssetPath (string $fileName, string $assetPath = null) : string

Inherited from ControllerBehavior

Locates a file based on it's definition. If the file starts with a forward slash, it will be returned in context of the application public path, otherwise it will be returned in context of the asset path.

Parameters
Property Description
$fileName
string

File to load.

$assetPath
string

Explicitly define an asset path.

Returns
string

Relative path to the asset file.

public getAssetPaths () : array

Inherited from ControllerBehavior

Returns an array of all registered asset paths.

Returns
array

public static getCalledExtensionClass ()

Inherited from ControllerBehavior
Returns
mixed

public getConfig (string $name = null, mixed $default = null) : string

Inherited from ControllerBehavior

Safe accessor for configuration values.

Parameters
Property Description
$name
string

Config name, supports array names like "field[key]"

$default
mixed

Default value if nothing is found

Returns
string

public getConfigPath (string $fileName, mixed $configPath = null) : string

Inherited from ControllerBehavior

Locates a file based on it's definition. If the file starts with the ~ symbol it will be returned in context of the application base path, otherwise it will be returned in context of the config path.

Parameters
Property Description
$fileName
string

File to load.

$configPath
mixed

Explicitly define a config path.

Returns
string

Full path to the config file.

public getViewPath (string $fileName, $viewPaths = null) : string

Inherited from ControllerBehavior

Locates a file based on its definition. The file name can be prefixed with a symbol (~|$) to return in context of the application or plugin base path, otherwise it will be returned in context of this object view path.

If the fileName cannot be found it will be returned unmodified.

Parameters
Property Description
$fileName
string
$viewPaths
mixed
Returns
string

public getViewPaths () : array

Inherited from ControllerBehavior

Returns the active view path locations.

Returns
array

public guessConfigPath (string $suffix = "") : string

Inherited from ControllerBehavior

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

Returns
string

public guessConfigPathFrom (string $class, string $suffix = "") : string

Inherited from ControllerBehavior

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

Returns
string

public guessViewPath (string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ControllerBehavior

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

public guessViewPathFrom (string $class, string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ControllerBehavior

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

public hasAssetsDefined () : bool

Inherited from ControllerBehavior

Returns true if assets any have been added.

Returns
bool

public makeAssets ($type = null) : string | null

Inherited from ControllerBehavior

Outputs <link> and <script> tags to load assets previously added with addJs, addCss, & addRss method calls depending on the provided $type

Parameters
Property Description
$type
mixed
Returns
string | null

public makeConfig (array $configFile = [], array $requiredConfig = []) : array | stdClass

Inherited from ControllerBehavior

Reads the contents of the supplied file and applies it to this object.

Parameters
Property Description
$configFile
array
$requiredConfig
array
Returns
array | stdClass

public makeConfigFromArray (array $configArray = []) : stdClass

Inherited from ControllerBehavior

Makes a config object from an array, making the first level keys properties of a new object.

Parameters
Property Description
$configArray
array

Config array.

Returns
stdClass

The config object

public makeFileContents (string $filePath, array $extraParams = []) : string

Inherited from ControllerBehavior

Makes all views in context of the controller, not the behavior.

Parameters
Property Description
$filePath
string

Absolute path to the view file.

$extraParams
array

Parameters that should be available to the view.

Returns
string

public makeFormWidget (string $class, array $fieldConfig = [], array $widgetConfig = []) : Backend\Classes\FormWidgetBase

Inherited from ControllerBehavior

Makes a form widget object with the supplied form field and widget configuration.

Parameters
Property Description
$class
string

Widget class name

$fieldConfig
array

A field name, an array of config or a FormField object.

$widgetConfig
array

An array of config.

Returns

The widget object

public makeLayout ($name = null, array $params = [], boolean $throwException = true) : string | bool

Inherited from ControllerBehavior

Render a layout, defaulting to the layout propery specified on the class

Parameters
Property Description
$name
mixed
$params
array
$throwException
boolean
Returns
string | bool

The layout contents, or false.

public makeLayoutPartial (string $partial, array $params = []) : string

Inherited from ControllerBehavior

Renders a layout partial

Parameters
Property Description
$partial
string
$params
array
Returns
string

public makePartial (string $partial, array $params = [], boolean $throwException = true) : mixed

Inherited from ControllerBehavior

Render a partial file contents located in the views folder.

Parameters
Property Description
$partial
string
$params
array
$throwException
boolean
Returns
mixed

Partial contents or false if not throwing an exception.

public makeView (string $view) : string

Inherited from ControllerBehavior

Loads the specified view. Applies the layout if one is set.

The view file must have the .php extension (or ".htm" for historical reasons) and be located in the views directory

Parameters
Property Description
$view
string
Returns
string

public makeViewContent (string $contents, $layout = null) : string

Inherited from ControllerBehavior

Renders supplied contents inside a layout.

Parameters
Property Description
$contents
string
$layout
mixed
Returns
string

public makeWidget (string $class, array $widgetConfig = []) : mixed | Backend\Classes\WidgetBase

Inherited from ControllerBehavior

Makes a widget object with the supplied configuration file.

Parameters
Property Description
$class
string

Widget class name

$widgetConfig
array

An array of config.

Returns

The widget object

public mergeConfig (mixed $configA, mixed $configB) : stdClass

Inherited from ControllerBehavior

Merges two configuration sources, either prepared or not, and returns them as a single configuration object.

Parameters
Property Description
$configA
mixed
$configB
mixed
Returns
stdClass

The config object

public resetSession () : void

Inherited from ControllerBehavior

Resets all session data related to this widget.

Returns
void

public setConfig (mixed $config, array $required = [])

Inherited from ControllerBehavior

Sets the configuration values

Parameters
Property Description
$config
mixed

Config object or array

$required
array

Required config items

Returns
mixed

protected addAsset (string $type, string $path, array $attributes)

Inherited from ControllerBehavior

Adds the provided asset to the internal asset collections

Parameters
Property Description
$type
string

The type of the asset: 'js' || 'css' || 'rss'

$path
string

The path to the asset

$attributes
array

The attributes for the asset

Returns
mixed

protected controllerMethodExists (string $methodName) : bool

Inherited from ControllerBehavior

Returns true in case if a specified method exists in the extended controller.

Parameters
Property Description
$methodName
string

Specifies the method name

Returns
bool

protected deferPurgedSaveAttributes (Winter\Storm\Database\Model $model, array $attributesToPurge) : void

Inherited from FormModelSaver

Removes an array of attributes from the model. If the model implements the Purgeable trait, this is preferred over the internal logic.

Parameters
Property Description
$model

Model to adjust.

$attributesToPurge
array

Attribute values to remove from the model.

Returns
void

protected extensionHideField ($name)

Inherited from ControllerBehavior
Parameters
Property Description
$name
mixed
Returns
mixed

protected extensionHideMethod ($name)

Inherited from ControllerBehavior
Parameters
Property Description
$name
mixed
Returns
mixed

protected getAssetEntryBuildPath (array $asset) : string

Inherited from ControllerBehavior

Internal helper, attaches a build code to an asset path

Parameters
Property Description
$asset
array

Stored asset array

Returns
string

protected getAssetScheme (string $asset) : string

Inherited from ControllerBehavior

Internal helper, get asset scheme

Parameters
Property Description
$asset
string

Specifies a path (URL) to the asset.

Returns
string

protected getLocalPath (string | null $relativePath)

Inherited from ControllerBehavior
Parameters
Property Description
$relativePath
string | null
Returns
mixed

protected getSession (string $key = null, string $default = null) : string

Inherited from ControllerBehavior

Retrieves a widget related key/value pair from session data.

Parameters
Property Description
$key
string

Unique key for the data store.

$default
string

A default value to use when value is not found.

Returns
string

protected handleViewException (Throwable $e, integer $obLevel) : void

Inherited from ControllerBehavior

Handle a view exception.

Parameters
Property Description
$e
Throwable
$obLevel
integer
Returns
void

protected hideAction (mixed $methodName)

Inherited from ControllerBehavior

Protects a public method from being available as an controller action.

These methods could be defined in a controller to override a behavior default action. Such methods should be defined as public, to allow the behavior object to access it. By default public methods of a controller are considered as actions. To prevent this occurrence, methods should be hidden by using this method.

Parameters
Property Description
$methodName
mixed

Specifies a method name.

Returns
mixed

protected makeSessionId () : string

Inherited from ControllerBehavior

Returns a unique session identifier for this widget and controller action.

Returns
string

protected prepareModelsToSave (Winter\Storm\Database\Model $model, array $saveData) : array

Inherited from FormModelSaver

Takes a model and fills it with data from a multidimensional array.

If an attribute is found to be a relationship, that relationship is also filled.

$modelsToSave = $this->prepareModelsToSave($model, [...]);

foreach ($modelsToSave as $modelToSave) {
    $modelToSave->save();
}
Parameters
Property Description
$model

Model to fill.

$saveData
array

Attribute values to fill model.

Returns
array

The collection of models to save.

protected putSession (string $key, mixed $value) : void

Inherited from ControllerBehavior

Saves a widget related key/value pair in to session data.

Parameters
Property Description
$key
string

Unique key for the data store.

$value
mixed

The value to store.

Returns
void

protected removeDuplicates () : void

Inherited from ControllerBehavior

Removes duplicate assets from the entire collection.

Returns
void

protected setModelAttributes (Winter\Storm\Database\Model $model, array $saveData) : void

Inherited from FormModelSaver

Sets a data collection to a model attributes, relations are also set.

Parameters
Property Description
$model

Model to fill.

$saveData
array

Attribute values to fill model.

Returns
void
Copyright © 2024 Winter CMS