If your using 1.2 definitely check out the wicked little behavior that is
bindable:

http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model
-bindings



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of sabkaraja
Sent: Monday, 3 March 2008 8:38 p.m.
To: Cake PHP
Subject: Unbind Reverse Relations in Recursive Queries


Hi

I have 3 models: Subject, Topic & Chapter

Subject > hasMany > Topics & Topic > belongsTo > Subject
Topic > hasMany > Chapters & Chapter > belongsTo > Topic
User > HABTM > Chapter

I am trying to do a recursive query ($this->Subject-
>findAll('Subject.enabled=1'); ) to find out all the subjects & topics
& chapters (and if needed users), I get results (copied only relevant
bits) like the following:

Array
(
    [Subject] => Array
        (
            [id] => 1
            ...........
            ...........

        )

    [Topic] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [subject_id] => 1
                    ...........
                    ...........
                    ...........
                    [Subject] => Array
                        (
                            [id] => 1
                            ...........
                            ...........
                        )

                    [Chapter] => Array
                        (
                            [0] => Array
                                (
                                    [id] => 1
                                    [topic_id] => 1
                                    ...........
                                    ...........
                                )

                        )

                )
    }
}

I want only a forward relationship records. that is: subject > Topics
> chapters > users. I dont want Topics > Subject query. This adds
considerable overhead to a findAll query.
How can I avoid that?

thanks




__________ NOD32 2915 (20080303) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to