Fields related configuration

Introduction

Fields are defined in the "meta_fields" array of a record class. Each key present in the array represent the name of the record property while its value is an array of configuration. By convention, fields take a singular form for standart properties, but they may take a plural form for associated records expecting zero or more associated records.

Property "type"

This property is tightly coupled with the database type of field. It may take the following values:

Property "min"

Define the minimum value. The "min" property is used to validate the record as well as to defined the field in the method "$table->update".

Default value is determined as follow:

Property "max"

Define the maximum value. The "max" property is used to validate the record as well as to defined the field in the method "$table->update"

Property "default"

Provide a default value if a record property is not set.

Additional properties

Plugins such as the "assocations", "hierarchical" and "order" plugins may add additionnal properties.

Open Source Object Relational Mapping in PHP

Download Porte 0.2.1