Browse files

Improving docs for find('threaded')

  • Loading branch information...
1 parent f685f49 commit 8e893e48d326b6ace2fb2c75cd881cc2310e65c5 @lorenzo lorenzo committed Jan 19, 2014
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/ORM/Table.php
View
12 src/ORM/Table.php
@@ -796,6 +796,18 @@ public function findList(Query $query, array $options = []) {
* 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

0 comments on commit 8e893e4

Please sign in to comment.