It looks to me like it's nothing to do with Cake - see your array:

 'OR'=>array(
    'AND'=>array(
       // some conditions // don't appear in the query
    ),
    'AND'=>array(
       // some other conditions // don't appear in the query
    ),
    'AND'=>array(
       // more conditions - only those appear in the query!
    )


The OR array has multiple settings under the key AND  - each of your
new ands overwrites the previous one, hence only the last conditions
appear.
I'm no expert, so take a look at 
http://book.cakephp.org/view/74/Complex-Find-Conditions
or search this group for good examples, but my guess would be that all
the conditions should go in just one AND array...



On Oct 14, 11:30 pm, Benni Graf <[EMAIL PROTECTED]> wrote:
> Hi there!
> I'm getting some data via this statement:
>
> $offtimes = $this->Offtime->find('all', array(
>  'conditions'=>array(
>   'AND'=>array(
>    'Offtime.therapist_id'=>$therapistid, // appears in the query
>    'OR'=>array(
>     'AND'=>array(
>        // some conditions // don't appear in the query
>     ),
>     'AND'=>array(
>        // some other conditions // don't appear in the query
>     ),
>     'AND'=>array(
>        // more conditions - only those appear in the query!
>     )
>    )
>   )
>  ),
>  'recursive'=>-1
> ));
>
> (left the actual conditions out for clarity)
>
> Unfortunately, only the last of the 3 AND-block gets considered for
> the query, the others are 'ignored' (they just don't appear in the
> query). The querys given in debug2-mode show me that. Also when I
> shuffle the order of the 3 AND-Blocks, only the last one appears in
> the query... Any ideas?
>
> Best regards and thanks for the Help!
>
> Btw, if you want to post some code, I also posted this to the 
> bin...:http://bin.cakephp.org/saved/38480
>
> Greetings, Benni.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to