I can’t manage to find a way to build a complete query from a CDbCriteria.
The CDbCommandBuilder has a method that creates the select query from a CDbCriteria, but ignores the "with" part.
What i need to to, is run a "CREATE TABLE … AS SELECT …" starting from the CDbCriteria associated with a CGridView. I have the criteria, all i need is the SELECT statement.
Does anybody have any ideeas ?
I looked around a lot and managed to do something myself, but i think it’s kind of clumbsy, and would require access to the “_joinTree” attribute of CActiveFinder, and that’s declared as PRIVATE.
I got the same problem, im converting one CDbCriteria to CDbCommand, but the JOIN part is left behind when I use CDbCommandBuilder->createFindCommand() passing my criteria.