Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Eraser] FatherID and CategoryID together?

Quote Reply
Re: [Eraser] FatherID and CategoryID together? In reply to
I would say that's the incorrect query, since you're saying I want (I assume you're searching on the Category table), all categories with FatherID that are either 275 or 44 AND CategoryID that's 163. I'm guessing you're wanting to do either. In that case, you need a GT::SQL::Condition object to do what you want. Something like:

$DB->table('Category', 'Links', 'CatLinks')->select(GT::SQL::Condition->new(FatherID => 'IN' => [275, 44], CategoryID => '=' => 163, 'OR'), VIEWABLE);

That makes it an OR condition between the two FatherID and CategoryID constraints, and we want to use the VIEWABLE constant instead of just checking for isValidated because that takes payments into consideration as well (if enabled).

Adrian
Subject Author Views Date
Thread FatherID and CategoryID together? Eraser 3164 Feb 10, 2009, 10:02 AM
Post Re: [Eraser] FatherID and CategoryID together?
Andy 3080 Feb 10, 2009, 10:27 AM
Post Re: [Eraser] FatherID and CategoryID together?
brewt 3069 Feb 10, 2009, 10:36 AM