"int", "float" and "order"
These types are subdivided on: "int" (integer), "float" (real), "order" (integer ordering number).
Purpose: operations with numeric data (prices, quantity, weight and so on), the "order" type is used to change the position of a record in admin panel. It has its own look with small arrows that help changing position in the list.
Field type in SQL table: "int" and "float" respectively
Additional parameters
"positive"
Purpose: accepts only positive values for this field
Possible values: "true", "false"
By default: "false"
"zero_allowed"
Purpose: accepts zero values for this field
Possible values: "true", "false"
By default: "true"
Record position "order"
To control the sequence number of an element in a list, there is a special data type of "order". By default it's an integer element for the values like: 1, 2, 5, 14. For a field with the "order" type in the main table of records in admin panel small arrows will appear to move elements among others in the list. Also, when creating a new record in admin panel this field will get the next following sequence number in the list automatically.
SQL queries often sort final result by this field (ORDER BY `field_name`). It's used for pages, products, articles and many other modules where an ordering of records is required for displaying on the website.
Field type in SQL table: "int".
Additional parameters
"depend_on_enum"
Purpose: locks a possibility of moving records by a click on arrows in the model table in admin panel. Lock is being removed when user sets a filter on specified field. Lock is required when changing counting numbers is allowed only if necessary filter is applied.
Possible values: field names of "enum" type in the current model, for example "supplier", "brand"
By default: "false"
Samples
array("Price", "int", "price") array("Weight", "float", "weight", array("required" => true)) array("Number", "int", "number", array("zero_allowed" => false, "positive" => true)) array("Position", "order", "order") array("Position in section", "order", "position", array("depend_on_enum" => "catalog"))
Previous section
"char"