"parent"
Purpose: allows to create parent-children dependence inside the model
Field type in SQL table: "int"
Additional parameters
"name_field"
Purpose: in output of the list of possible values of model a "name" field is being looked for, if not found, you need to specify a field which will be used instead as titles for the "select" tag options
Possible values: name of a field, for example "first_name", "label", "date"
By default: "name"
"max_depth"
Purpose: maximum nested depth (a quantity of possible sub levels of a tree)
Possible values: integer positive value
By default: not set
"parent_for"
Purpose: will organize a composition with another model based on "directory -> subdirectory -> subdirectory -> product" principle. The current model has nested subsections which may contain records from other model. More details are described in
Trees section.
Possible values: name of a model, for example "Products", "Topics"
By default: not set
Samples
array("Parent section", "parent", "parent") array("Section", "parent", "parent", array("name_field" => "title")) array("Catalog", "parent", "catalog", array("parent_for" => "Products", "max_depth" => 3, "show_parent" => true))
Previous section
"enum"