|
|
@@ -796,6 +796,18 @@ class Table implements EventListener {
|
|
|
* Values belonging to a parent row based on their parent_id value will be
|
|
|
* recursively nested inside the parent row values using the `children` property
|
|
|
*
|
|
|
+ * You can customize what fields are used for nesting results, by default the
|
|
|
+ * primary key and the `parent_id` fields are used. If you you wish to change
|
|
|
+ * these defaults you need to provide the keys `idField` or `parentField` in
|
|
|
+ * `$options`:
|
|
|
+ *
|
|
|
+ * {{{
|
|
|
+ * $table->find('threaded', [
|
|
|
+ * 'idField' => 'id',
|
|
|
+ * 'parentField' => 'ancestor_id'
|
|
|
+ * ]);
|
|
|
+ * }}}
|
|
|
+ *
|
|
|
* @param \Cake\ORM\Query $query
|
|
|
* @param array $options
|
|
|
* @return \Cake\ORM\Query
|