Description

Provides a form context around a single entity and its relations. It also can be used as context around an array or iterator of entities. This class lets FormHelper interface with entities or collections of entities. Important Keys: - `entity` The entity this context is operating on. - `table` Either the ORM\Table instance to fetch schema/validators from, an array of table instances in the case of a form spanning multiple entities, or the name(s) of the table. If this.isNull the table name(s) will be determined using naming conventions. - `validator` Either the Validation\Validator to use, or the name of the validation method to call on the table object. For example "default". Defaults to "default". Can be an array of table alias=>validators when dealing with associated forms.

Properties

Methods

InheritedAbstractFinalStaticDatatypeHeader
boolbool isPrimaryKey(string pathToField)
JsonJson _getProp(Json mytarget, string fieldName)
boolbool hasError(string fieldPath)
boolbool isRequired(string fieldName)
JsonJson _schemaDefault(Json[string] pathParts)
Json[string]Json[string] leafEntity(Json[string] mypath = null)
Json[string]Json[string] attributes(string fieldPath)
intint getMaxLength(string fieldPath)
IError[]IError[] errors(string fieldPath)
boolbool initialize(Json[string] initData = null)
string[]string[] fieldNames()
stringstring type(string fieldPath)
string[]string[] primaryKeys()
boolbool isCreate()
Json[string]Json[string] _extractMultiple(Json myvalues, Json[string] mypaths)
stringstring getRequiredMessage(string fieldName)
IValidatorIValidator _getValidator(Json[string] pathParts)
JsonJson _getProp(IEntity mytarget, string fieldName)
voidvoid _prepare()
IEntityIEntity /* |iterable|null */ entity(Json[string] mypath = null)
ITableITable _getTable(/* IEntity| * /string[] pathParts, bool isFallback = true)
JsonJson val(string fieldPath, Json[string] options = null)