UnionOfRAD/lithium — pull request #663 by jails (2012-10-02 18:43:22+00:00)
Title: Implementing new features for queries Warning BC BREAK

BC break:
- the `'constraint'` option is now `'constraints'` (i.e with an extra 's')
- the constraints now behave like conditions (i.e the right hand side are automagically escaped, use (object) casting to avoid this behavior)
- Query::constraints() has been removed (see Database::on() for PDO datasources)

New Features :
- Queries are now exported according a datasource strategy (Acutally only the joined strategy (i.e. LEFT JOIN) have been implemented).

Experimental :
- If such notation : `Post::find('all', array('with' => array('Tagging.Tags')));` would now works on PDO datasources, the lacks of "fixtures" (#603) makes tests impossible (for me at least) for this part.
- Feel free to comment this PR if you notice something wrong.

Next step :
- Allow Queries to contain subqueries.
- Allow Datasource to manage queries with subqueries.
- Implements the "subquery strategy" for both PDO and NoSql datasource.