I'm building some query with the DB class, and i noticed something with the AND_ON statement. This is the doc content for this entry :
$c1 mixedrequired table name or array($table, $alias)
$op stringrequired logical operator
$c2 mixedrequired table name or array($table, $alias)
With a ON statement no need the have other possibility than tables name. But with a "and_on", i may want to do something else, like :
"SELECT table1.field1, table2.field1 FROM table1 LEFT JOIN table2 ON table1.field1 = table2.field1 AND table2.field2 = "JOHN DOE"
The SQL ON clause isn't limited to table name, i can take values to. But FuelPHP wrap everything with grave accent, so values like my "JOHN DOE" are interpreted as tables and fire an error.
Reflecting the query (if no john doe in field2, it return a data with field2 set to null, with LEFT in JOIN clause, i dont want the query's behavior to ommit results when field2 is null) I can't use WHERE clause, i have to put it in the ON.
Temporary solution would be to just write my query inside on building it. Except if i'm wrong and there is a simple way to do it with query builder, can we imagine extending it with a method like "on_value" and its variation "and" and "or" , witch would wrap the third parameter with quotation marks instead of grave accent in a futur version ?