Fr3nch13/CakePHP Utilities

Schema
in package

Contains the schema information for Form instances.

Table of Contents

Properties

$_fieldDefaults  : array<string, mixed>
The default values for fields.
$_fields  : array<string, array<string, mixed>>
The fields in this schema.

Methods

__debugInfo()  : array<string, mixed>
Get the printable version of this object
addField()  : $this
Adds a field to the schema.
addFields()  : $this
Add multiple fields to the schema.
field()  : array<string, mixed>|null
Get the attributes for a given field.
fields()  : array<string|int, string>
Get the list of fields in the schema.
fieldType()  : string|null
Get the type of the named field.
removeField()  : $this
Removes a field to the schema.

Properties

$_fieldDefaults

The default values for fields.

protected array<string, mixed> $_fieldDefaults = ['type' => null, 'length' => null, 'precision' => null, 'default' => null]

$_fields

The fields in this schema.

protected array<string, array<string, mixed>> $_fields = []

Methods

__debugInfo()

Get the printable version of this object

public __debugInfo() : array<string, mixed>
Return values
array<string, mixed>

addField()

Adds a field to the schema.

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

The field name.

$attrs : array<string, mixed>|string

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

Return values
$this

addFields()

Add multiple fields to the schema.

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

The fields to add.

Return values
$this

field()

Get the attributes for a given field.

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

The field name.

Return values
array<string, mixed>|null

The attributes for a field, or null.

fields()

Get the list of fields in the schema.

public fields() : array<string|int, string>
Return values
array<string|int, string>

The list of field names.

fieldType()

Get the type of the named field.

public fieldType(string $name) : string|null
Parameters
$name : string

The name of the field.

Return values
string|null

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

removeField()

Removes a field to the schema.

public removeField(string $name) : $this
Parameters
$name : string

The field to remove.

Return values
$this

        
On this page

Search results