"many_to_one"
Purpose: display the total numer of records in the linked model (by foreign key)
Field type in SQL table: the field column isn't created in database
Additional parameters
"related_model"
Purpose: the required parameter indicating the model which has "enum" field with a foreign key that is the name of the current model
Possible values: name of a model, for example "Products", "Topics"
"name_field"
Purpose: if there is no such a field as "name" in the linked model, you need to specify a nominal field
Possible values: text, for example "title"
By default: not set
Samples
array("Comments", "many_to_one", "comments", array("related_model" => "News")) array("Orders", "many_to_one", "orders", array("related_model" =>"Orders", "name_field" => "number"))
Previous section
"parent"