ZF-1428: Adapter fetchAll() method should have an optional fetch-mode argument
Description
Kirill Balyasnikov writes:
Why is it not possible to specify fetch mode directly in method calls such as:
$connection->fetchAll($queryString, $bindArray, PDO::FETCH_ASSOC);
It's not very convinient to call setFetchMode and getFetchMode before and after the call to restore previous state.
For example i have 10 methods in different classes and sometimes i need to get results as numeric array and sometimes as assoc array. So to be sure everything is working ok i have to setFetchMode before every fetchXXX call.
Comments
Posted by Bill Karwin (bkarwin) on 2007-05-24T10:54:50.000+0000
The workaround you can use now is to write a loop to fetch(), and in the fetch() method you can specify the fetch mode:
Posted by Simon Mundy (peptolab) on 2008-01-26T17:48:03.000+0000
Sounds reasonable to me. I'll commit this soon.
Posted by Simon Mundy (peptolab) on 2008-01-26T18:18:14.000+0000
Resolved in trunk r7649