UnionOfRAD/lithium — pull request #753 by jails (2012-12-19 17:43:45+00:00)
Title: The `'joined'` strategy now lazy load primary keys when needed.

When the `'joined'` strategy is used, all primary keys of relations are automagically added to the query to allow a correct hydratation of nested entities. However this strategy pollute the result with extra datas.

previously:
```php
Images::find('all',
'fields' => array('Image'),
'with' => array('ImagesTags.Tags'),
'conditions' => array('Tags.name' => 'flower')
);
```

produce:
```php
array(
0 => array(
'id' => 5,
'name' => 'Tulip',
'images_tags' => array(
0=> array(
'id' => 1
'tags' => array(
'id' => 2
)
)
/*...and so on....*/
)
)
/*...and so on....*/
```

Since `'fields' => array('Image')`, the hydratation up to `Tags` is not necessary.

This PR allow to produce results with less "polluting datas".