dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 136 forks source link

Huge BC break for fetchAssoc and fetchPairs #284

Closed SendiMyrkr closed 6 years ago

SendiMyrkr commented 6 years ago

Description

At least fetchAssoc and fetchPairs ignores setResult, following example works for dibi 3, dibi 4 throws "Unknown column 'playerId' in associative descriptor"

Steps To Reproduce

$q = dibi::select('player_id')->from('players');

$q->setupResult('setRowFactory', function(array $row) {
    $line = new \stdClass();
    $line->playerId = $row['player_id'];

    return $line;
});

print_r($q->fetchAssoc('playerId'));
print_r($q->fetchPairs('playerId', 'playerId'));
dg commented 6 years ago

Yes, there is actually a BC break here. I did not expect anyone to use RowFactory in this way.