That's several years old; the core has changed a lot since then. You can do:
$this->YourModel->find(
'threaded',
array(
'conditions' => array('YourModel.parent_id IS NOT NULL')
)
);
For example, here's a find() I'm using in a Section model, where I
want to get only those Sections that a particular Group is allowed to
see (record-level ACL).
public function threadedWithGroupPerms($group_aro_id)
{
return $this->find(
'threaded',
array(
'conditions' => array('Section.parent_id IS NOT NULL'),
'recursive' => 1,
'fields' => array('*'),
'order' => array('Section.lft' => 'ASC'),
'joins' => array(
array(
'table' => 'acos',
'alias' => 'Aco',
'type' => 'inner',
'conditions'=> array(
'Aco.model' => 'Section',
'Aco.foreign_key = Section.id'
)
),
array(
'table' => 'aros_acos',
'alias' => 'Permission',
'type' => 'inner',
'conditions'=> array(
'Permission.aco_id = Aco.id',
"Permission.aro_id =
${group_aro_id}"
)
)
)
)
);
}
On Thu, Sep 17, 2009 at 6:40 AM, albe <[email protected]> wrote:
>
> Referring to:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/94ec5a3d33f2a935/ba469c8c052674b8?lnk=gst&q=findAllThreaded&rnum=1#ba469c8c052674b8
>
> Any advice on how is it possible to obtain the same thing without
> editing the core?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---