FormModelWidget
trait FormModelWidget
Form Model Widget Trait
Special logic for for form widgets that use a database stored model.
Properties
protected | $modelsToSave |
Methods
createFormModel()
No description
findFormModel($recordId)
No description
array
resolveModelAttribute(string $attribute = null)
Returns the final model and attribute name of a nested HTML array attribute.
getRelationModel()
Returns the model of a relation type.
getRelationObject()
No description
getRelationType()
No description
prepareModelsToSave($model, $saveData)
No description
void
setModelAttributes(Model $model, array $saveData)
Sets a data collection to a model attributes, relations will also be set.
Details
at line 18
createFormModel()
No description
at line 34
Model
findFormModel($recordId)
No description
at line 62
array
resolveModelAttribute(string $attribute = null)
Returns the final model and attribute name of a nested HTML array attribute.
Eg: list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom);
at line 80
protected Relation
getRelationModel()
Returns the model of a relation type.
at line 94
protected
getRelationObject()
No description
at line 108
protected
getRelationType()
No description
at line 115
protected
prepareModelsToSave($model, $saveData)
No description
at line 132
protected void
setModelAttributes(Model $model, array $saveData)
Sets a data collection to a model attributes, relations will also be set.