/** Add both the join clauses, the WHERE clause and eventual ORDER BY clause * from the suppleid SQL spec. * @paranm PntSqlSpec $spec Object that sepecifies the query and may generate the SQL */ function addSqlFromSpec($spec, $groupBy=false) { $extra = $spec->getExtraSelectExpressions(); $this->query = str_replace(' FROM ', $extra. ' FROM ', $this->query); $this->query .= $spec->getSqlForJoin(); $this->query .= "\n WHERE "; $this->query .= $spec->getSql_WhereToLimit($groupBy); $spec->addParamsTo($this); //Gen::show($this->query); Gen::show($this->parameters); } |