\Cake\FormSchema

Contains the schema information for Form instances.

Summary

Methods
Properties
Constants
addFields()
addField()
removeField()
fields()
field()
fieldType()
__debugInfo()
No public properties found
No constants found
No protected methods found
$_fields
$_fieldDefaults
N/A
No private methods found
No private properties found
N/A

Properties

$_fields

$_fields : array

The fields in this schema.

Type

array

$_fieldDefaults

$_fieldDefaults : array

The default values for fields.

Type

array

Methods

addFields()

addFields(array  $fields) : $this

Add multiple fields to the schema.

Parameters

array $fields

The fields to add.

Returns

$this

addField()

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

$this

removeField()

removeField(string  $name) : $this

Removes a field to the schema.

Parameters

string $name

The field to remove.

Returns

$this

fields()

fields() : array<mixed,string>

Get the list of fields in the schema.

Returns

array<mixed,string> —

The list of field names.

field()

field(string  $name) : null|array

Get the attributes for a given field.

Parameters

string $name

The field name.

Returns

null|array —

The attributes for a field, or null.

fieldType()

fieldType(string  $name) : string|null

Get the type of the named field.

Parameters

string $name

The name of the field.

Returns

string|null —

Either the field type or null if the field does not exist.

__debugInfo()

__debugInfo() : array

Get the printable version of this object

Returns

array