Browse Source

Improving docs for find('threaded')

Jose Lorenzo Rodriguez 12 years ago
parent
commit
8e893e48d3
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/ORM/Table.php

+ 12 - 0
src/ORM/Table.php

@@ -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