Saturday, February 28, 2009

Re: Complex model relationship problems

On Feb 28, 2:07 pm, Dan Soendergaard <dan1...@gmail.com> wrote:
> That doesn't help much, I've tried it and it gives errors like this:
>
> Model "Space" is not associated with model "name" [CORE/cake/libs/
> model/behaviors/containable.php, line 340]

Strange error. Is this what you tried:

function get_structure($user = null) {
$spaces = $this->Space->find('threaded', array(
'conditions' => array('User.id' =>
$user),
'fields' => array('Space.name',
'Space.description', 'Space.created', 'Space.parent_id', 'Space.lft',
'Space.rght', 'User.id', 'User.username'),
'contain' => array(
'User', 'Document'
),
'order' => array('Space.name')
)
);

return array('spaces' => $spaces);
}

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: