On May 19, 9:40 pm, Anna P <apad...@o2.pl> wrote:
> Hello.
> Can anyone help me with hacking findAllThreaded function for version
> 1.2.x ?
>
> In 1.1.x it looked like it to set the root ID for function:
>
> function findAllThreaded($root = null, $conditions = null, $fields =
> null, $sort = null) {
>     return $this->__doThread(Model::findAll($conditions, $fields,
> $sort), $root);
>
> }
>
> But in 1.2.x findAllThreaded is deprecated:
>
> function findAllThreaded($conditions = null, $fields = null, $order =
> null) {
>     return $this->find('threaded', compact('conditions', 'fields',
> 'order'));
>
> }
>
> How to supply to findAllThreaded function the root ID of a model which
> I want to get all children from?

You don't.

You specify conditions such that the find('all') call contains
everything you want

like find('threaded', array('conditions' => array('category' =>
'foo')));
or (if using the tree behavior)
$this->id = $foo;
$lft = $this->field('lft');
$rght = $this->field('rght');
find('threaded', array('conditions' => array('lft >=' => $lft, 'rght
<=' => $rght)));

It is not designed to "allow" you to retrieve unnecessary data and
cherry pick the bit you want.

AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to