vrana/notorm — pull request #44 by xpavp03 (2012-04-16 16:40:39+00:00)
Title: fix fetchPairs() to work with referenced tables

Take this query as an example:
$notorm->course[92]->hole('deleted', null)->order('rank')->fetchPairs('rank', 'rank');

It generates the following SQL:
SELECT holes.course, rank, rank
FROM holes
WHERE (holes.course IN (92)) AND (deleted IS NULL)
ORDER BY holes.course, rank

The query itself is all right but fetchPairs() in your implementation returned
array('92' => '18')
instead of
array('1'=>'1', '2'=>'2', ..., '18' => '18');

The culprit was that fetchPairs used $values[0] as key which in this case was the course id. And I couldn't remove course id from the first position in results.

I suggest to make fetchPairs() use $key/$value directly (instead of numerical indexes).