Class Schema
Contains the schema information for Form instances.
Property Summary
-
$_fieldDefaults protected
arrayThe default values for fields.
-
$_fields protected
arrayThe fields in this schema.
Method Summary
-
__debugInfo() public
Get the printable version of this object
-
addField() public
Adds a field to the schema.
-
addFields() public
Add multiple fields to the schema.
-
field() public
Get the attributes for a given field.
-
fieldType() public
Get the type of the named field.
-
fields() public
Get the list of fields in the schema.
-
removeField() public
Removes a field to the schema.
Method Detail
addField() ¶ public
addField(string $name, string|array $attrs): $this
Adds a field to the schema.
Parameters
-
string$name The field name.
-
string|array$attrs The attributes for the field, or the type as a string.
Returns
$thisaddFields() ¶ public
addFields(array $fields): $this
Add multiple fields to the schema.
Parameters
-
array$fields The fields to add.
Returns
$thisfield() ¶ public
field(string $name): null|array
Get the attributes for a given field.
Parameters
-
string$name The field name.
Returns
null|arrayThe attributes for a field, or null.
fieldType() ¶ public
fieldType(string $name): string|null
Get the type of the named field.
Parameters
-
string$name The name of the field.
Returns
string|nullEither the field type or null if the field does not exist.
fields() ¶ public
fields(): array
Get the list of fields in the schema.
Returns
arrayThe list of field names.
removeField() ¶ public
removeField(string $name): $this
Removes a field to the schema.
Parameters
-
string$name The field to remove.
Returns
$this