Parent
Purpose: allows you to create descendants for records, thereby organizing a tree.
Field type in SQL table: int
Additional parameters:
name_field
Purpose: when displaying a list of possible model values, a field named 'name' is searched for; if this field is missing, then you must specify the field that will be used as a named field
Possible values: field name, for example 'first_name', 'label', 'date'
Default: 'name'
max_depth
Purpose: maximum nesting depth, number of possible tree sublevels
Possible values: positive integer
Default: null
parent_for
Purpose: organizes a connection with another model based on the catalog principle -> catalog -> catalog -> product. The current model has nested subsections that may contain records from another model.
Possible values: model name, e.g. 'Products', 'Topics'
Default: null
show_parent
Purpose: additionally shows the parent name for the field values
Possible values: true, false
Default: false
Examples:
['Parent section', 'parent', 'parent']
['Section', 'parent', 'section', ['name_field' => 'title']]
['Catalog', 'parent', 'catalog', ['parent_for' => 'Products',
'max_depth' => 3,
'show_parent' => true]]
Previous section
Choice enum