On Thu, Jan 8, 2009 at 5:16 AM, Adam Royle <[email protected]> wrote: > > Hi Rob, > > For complex conditions you're probably better off using a combination > of strings and arrays. > > I find they're much simpler to read than cake's array syntax... > > 'conditions' => array( > array('alert_subject_id' => $subject), > '(Alert.start_date IS NULL OR Alert.start_date < NOW())', > '(Alert.end_date IS NULL OR Alert.end_date > NOW())', > )
I like that. To my eye, at least, it's far more readable. Thanks for the hint. > Also, the reason why your initial array wasn't working is because you > defined two "OR" keys in the same array, when only one can exist. Yeah, eventually I figured that out on my own (which was a very small consolation for not having seen it immediately). :-) -- Rob Wilkerson http://robwilkerson.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
