Skip to content

Commit 8e893e4

Browse files
committed
Improving docs for find('threaded')
1 parent f685f49 commit 8e893e4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ORM/Table.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,18 @@ public function findList(Query $query, array $options = []) {
796796
* Values belonging to a parent row based on their parent_id value will be
797797
* recursively nested inside the parent row values using the `children` property
798798
*
799+
* You can customize what fields are used for nesting results, by default the
800+
* primary key and the `parent_id` fields are used. If you you wish to change
801+
* these defaults you need to provide the keys `idField` or `parentField` in
802+
* `$options`:
803+
*
804+
* {{{
805+
* $table->find('threaded', [
806+
* 'idField' => 'id',
807+
* 'parentField' => 'ancestor_id'
808+
* ]);
809+
* }}}
810+
*
799811
* @param \Cake\ORM\Query $query
800812
* @param array $options
801813
* @return \Cake\ORM\Query

0 commit comments

Comments
 (0)