W3cubDocs

/CakePHP 4.4

Class Schema

Contains the schema information for Form instances.

Namespace: Cake\Form

Property Summary

  • $_fieldDefaults protected
    array<string, mixed>

    The default values for fields.

  • $_fields protected
    array<string, array<string, mixed>>

    The 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

__debugInfo() public

__debugInfo(): array<string, mixed>

Get the printable version of this object

Returns

array<string, mixed>

addField() public

addField(string $name, array<string, mixed>|string $attrs): $this

Adds a field to the schema.

Parameters

string $name

The field name.

array<string, mixed>|string $attrs

The attributes for the field, or the type as a string.

Returns

$this

addFields() public

addFields(array<string, array<string, mixed>|string> $fields): $this

Add multiple fields to the schema.

Parameters

array<string, array<string, mixed>|string> $fields

The fields to add.

Returns

$this

field() public

field(string $name): array<string, mixed>|null

Get the attributes for a given field.

Parameters

string $name

The field name.

Returns

array<string, mixed>|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|null

fields() public

fields(): array<string>

Get the list of fields in the schema.

Returns

array<string>

removeField() public

removeField(string $name): $this

Removes a field to the schema.

Parameters

string $name

The field to remove.

Returns

$this

Property Detail

$_fieldDefaults protected

The default values for fields.

Type

array<string, mixed>

$_fields protected

The fields in this schema.

Type

array<string, array<string, mixed>>

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Form.Schema.html