nette/nette — pull request #1084 by hrach (2013-04-29 11:48:14+00:00)
Title: RFC: allow tranform Db\ResultSet to Db\Table\ResultSet

This is RFC, it's more about relationships and implementation than naming and API.

This PR will allow to run own SQL query, but you will be able to process request as it would be done by Selection.

```php
$query = $connection->query('SELECT * FROM book ORDER BY id');
$result = new ResultSet('book', $query, $connection, new DiscoveredReflection($connection, $cacheStorage), $cacheStorage);

$book = $result->fetch();
echo $book->title;
echo $book->author->title;
foreach ($book->related('book_tag') as $bookTag) {
echo $bookTag->tag->name;
}
```