@Andreas, thanks for the tip and example code. It hasn't really dawned on me
what I was doing there. At the moment I'm happy if I don't get a stack
trace. :)
As an aside, I had to change your 'recursive' => -1 to 0 for it to work
correctly.
@Jeremy, thanks for your reply and example code. I'll have to have a think
about it, as while I can see where you're going, it's not sitting nicely in
my brain quite yet.
I meant TINYINT(1) in my OP, not INT(1), that's just me working on other
projects too much. Field is definately unsigned. :)
Time passes...
I could not get your first example to work correctly (there is a lot of
trial and error going on here) but the second example, with the condition,
worked perfectly:
'contain' => array(
'Product' => array(
'conditions' => array('Product.published' => 1)
)
)
I also created this line, which now sits in my ProductsController's index
action, which is a lot more succinct than the code I had:
$this->set('products', $this->paginate('Product', array('published' => 1)));
Thanks for the input, it's helped significantly.
Paul.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php