FormModelWidget
Form Model Widget Trait
Special logic for for form widgets that use a database stored model.
Tags
Table of Contents
- resolveModelAttribute() : array<string|int, mixed>
- Returns the final model and attribute name of a nested HTML array attribute.
- getRelationModel() : Relation
- Returns the model of a relation type, supports nesting via HTML array.
- getRelationObject() : Relation
- Returns the value as a relation object from the model, supports nesting via HTML array.
- getRelationType() : Relation
- Returns the value as a relation type from the model, supports nesting via HTML array.
Methods
resolveModelAttribute()
Returns the final model and attribute name of a nested HTML array attribute.
public
resolveModelAttribute(mixed $attribute) : array<string|int, mixed>
Eg: list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom);
Parameters
- $attribute : mixed
Return values
array<string|int, mixed> —getRelationModel()
Returns the model of a relation type, supports nesting via HTML array.
protected
getRelationModel() : Relation
Return values
Relation —getRelationObject()
Returns the value as a relation object from the model, supports nesting via HTML array.
protected
getRelationObject() : Relation
Return values
Relation —getRelationType()
Returns the value as a relation type from the model, supports nesting via HTML array.
protected
getRelationType() : Relation